feat: finish adding module tasks

This commit is contained in:
Neil Hanlon 2021-06-10 23:56:15 -04:00
parent 0ce6889ca0
commit 316db5afbe
Signed by: neil
GPG Key ID: 705BC21EC3C70F34
2 changed files with 61 additions and 1 deletions

View File

@ -8,7 +8,7 @@ Type=simple
User=pinnwand
Group=pinnwand
WorkingDirectory=/opt/pinnwand/
ExecStart=/opt/pinnwand/bin/matterbridge --configuration-path pinnwand.toml
ExecStart=/opt/pinnwand/.local/bin/pinnwand --configuration-path pinnwand.toml
Restart=always
RestartSec=60

View File

@ -1,2 +1,62 @@
---
# tasks file for pinnwand
- name: "install {{ item }}"
package:
state: present
name: "{{ item }}"
with_items:
- python39
- python39-setuptools
- python39-pip
- name: create pinnwand system user
user:
name: pinnwand
comment: "system user to run pinnwand - do not use"
system: yes
home: "/opt/pinnwand"
create_home: yes
- name: create/set permissions on /opt/pinnwand static config directory
file:
state: directory
recurse: yes
path: "/opt/pinnwand"
mode: 0755
owner: pinnwand
group: pinnwand
setype: etc_t
seuser: system_u
- name: install pinnwand into virtualenv
pip:
name: pinnwand
extra_args: --user
executable: pip3.9
notify: restart pinnwand
- name: install /opt/pinnwand/pinnwand.toml
template:
src: pinnwand.toml
dest: "/opt/pinnwand/pinnwand.toml"
mode: 0640
owner: pinnwand
group: pinnwand
setype: etc_t
seuser: system_u
notify: restart pinnwand
- name: add /etc/systemd/system/pinnwand.service (systemd unit file)
copy:
src: pinnwand.service
dest: "/etc/systemd/system/pinnwand.service"
mode: 0644
seuser: system_u
setype: systemd_unit_file_t
- name: start/enable pinnwand.service
service:
name: pinnwand
state: started
enabled: yes