summaryrefslogtreecommitdiffstats
path: root/deployment/playbook.yml
blob: 96fbc44b45fbf2a561ff5d75e06ad47837addd89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
- hosts: bitvend
  tasks:
    - apt: name="{{ item }}" state=present
      with_items:
        - pigpio
        - python3-pigpio
        - python3-pip
        - python3-pillow
        - nginx
        - dehydrated
    - user: name=bitvend home=/var/bitvend system=yes
    - synchronize: src=../../ dest=/var/bitvend
    - file: path=/var/bitvend owner=bitvend group=bitvend recurse=yes
    - pip: requirements=/var/bitvend/requirements.txt executable=/usr/bin/pip3
    - copy: src=bitvend.service dest=/etc/systemd/system
    - copy: src=nginx.site dest=/etc/nginx/sites-available/default
    - service: name=nginx state=reloaded
    - service: name=pigpiod enabled=yes state=started
    - service: name=bitvend enabled=yes state=started

    # Cleanup
    - user: name=pi state=absent