Adding auto upgrade service
This commit is contained in:
parent
424dc8051f
commit
f1eeff4785
3 changed files with 34 additions and 0 deletions
|
@ -289,3 +289,20 @@
|
||||||
name: nginx
|
name: nginx
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
||||||
|
|
||||||
|
- name: Deploy snipeit upgrade service
|
||||||
|
template:
|
||||||
|
src: snipeit-upgrade.service.j2
|
||||||
|
dest: /etc/systemd/system/snipeit-upgrade.service
|
||||||
|
notify: Daemon Reload
|
||||||
|
|
||||||
|
- name: Deploy snipeit upgrade timer
|
||||||
|
template:
|
||||||
|
src: snipeit-upgrade.timer.j2
|
||||||
|
dest: /etc/systemd/system/snipeit-upgrade.timer
|
||||||
|
notify: Daemon Reload
|
||||||
|
|
||||||
|
- name: Enable systemd timer for snipeit upgrade
|
||||||
|
service:
|
||||||
|
name: snipeit-upgrade.timer
|
||||||
|
enabled: yes
|
||||||
|
|
8
roles/snipeit/templates/snipeit-upgrade.service.j2
Normal file
8
roles/snipeit/templates/snipeit-upgrade.service.j2
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
[Unit]
|
||||||
|
Description=SnipeIt Auto Upgrade Service
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
WorkingDirectory=/opt/snipeit
|
||||||
|
User={{ ansible_user }}
|
||||||
|
Group={{ ansible_user }}
|
||||||
|
ExecStart=/bin/bash -c 'git pull && php composer.phar update --no-interaction && php upgrade.php --no-interactive'
|
9
roles/snipeit/templates/snipeit-upgrade.timer.j2
Normal file
9
roles/snipeit/templates/snipeit-upgrade.timer.j2
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
[Unit]
|
||||||
|
Description=SnipeIt Renewal Timer
|
||||||
|
[Timer]
|
||||||
|
WakeSystem=false
|
||||||
|
OnCalendar=Sat *-*-* 05:00
|
||||||
|
RandomizedDelaySec=600
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
Loading…
Reference in a new issue