Add basic README blob master
[LocalChat.git] / ansible / roles / localchat-server / tasks / main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---

- name: Install Utils
  apt: name={{item}} state=installed
  with_items:
    - python-pip
    - python-sqlite
    - unzip
  tags: deps

- name: Install Python Dependancies
  pip: name={{item}} state=present
  with_items:
    - flask
    - werkzeug
    - bcrypt
    - gnupg
    - pyopenssl
  tags: deps


- name: Create install dir
  file: path={{localchat_server_install_path}} state=directory
  
- name: Download and install Server
  unarchive:
    src: "https://github.com/bentasker/LocalChat/archive/v{{localchat_server_install_ver}}.zip"
    dest: "{{localchat_server_install_path}}"
    remote_src: yes
  
- name: Symlink latest
  file:
    src: "{{localchat_server_install_path}}/LocalChat-{{localchat_server_install_ver}}/server/LocalChat.py"
    dest: "{{localchat_server_install_path}}/LocalChat.py"
    state: link
    
- name: Create Unit File
  template: src=localchat.service dest=/etc/systemd/system/localchat.service
  notify: reload systemd


- name: Start server
  command: systemctl start localchat