Make the new lightrix work with ansible

master
Ryan Rix 8 years ago
parent 5c1356a1de
commit e3cd669a70

@ -7,5 +7,5 @@ WantedBy=default.target
[Service]
Type=simple
ExecStart=/usr/bin/python /root/lightrix.py --room '{{lightrix_room_id}}' -c /root/.mcatrc
ExecStart=/usr/bin/python /root/lightrix/lightrix.py -r '{{lightrix_room_id}}' -c /root/.mcatrc
Restart=on-failure

@ -0,0 +1,5 @@
click==6.3
matrix-client==0.0.2
pytz==2015.7
PyYAML==3.11
requests==2.7.0

@ -1,33 +1,17 @@
---
- name: Ensure rpi_ws281x is cloned
git:
dest: /root/rpi_ws281x/
repo: https://github.com/jgarff/rpi_ws281x.git
update: no
- name: Ensure rpi_ws281x is built
shell: >-
cd /root/rpi_ws281x/ && scons
- name: Ensure the neopixel python library is built
shell: >-
cd /root/rpi_ws281x/python/ && python setup.py install
- name: Ensure pip is installed
yum:
- include: rpi_ws281x.yml
- name: pip is installed
apt:
state: latest
name: python-pip
- name: Ensure lightrix dependencies are installed
- name: pip is upgraded
pip:
state: latest
name: "{{item}}"
with_items:
- matrix-client
- pyyaml
- pytz
- name: Ensure lightrix systemd service is installed
name: pip
- name: lightrix systemd service is installed
template:
src: lightrix.service
dest: /etc/systemd/system/lightrix.service
@ -35,16 +19,25 @@
- reload systemd
- restart lightrix
- name: Ensure mcat configuration is installed
- name: mcat configuration is installed
template:
src: mcatrc
dest: /root/.mcatrc
notify:
- restart lightrix
- name: Ensure lightrix is installed
copy:
src: lightrix.py
dest: /root/lightrix.py
- name: lightrix is installed
synchronize:
src: ../../../
dest: /root/lightrix
rsync_opts: --exclude=.git
notify:
- restart lightrix
- name: lightrix dependencies are installed
pip:
state: present
requirements: /root/lightrix/requirements.txt
notify:
- restart lightrix

@ -0,0 +1,23 @@
---
- name: dependencies are installed
apt:
state: installed
name: "{{item}}"
with_items:
- swig
- python-dev
- scons
- name: rpi_ws281x is cloned
git:
dest: /root/rpi_ws281x/
repo: https://github.com/jgarff/rpi_ws281x.git
update: no
- name: rpi_ws281x is built
shell: >-
cd /root/rpi_ws281x/ && scons
- name: the neopixel python library is built
shell: >-
cd /root/rpi_ws281x/python/ && python setup.py install
Loading…
Cancel
Save