Add service units using r10k

This commit is contained in:
Antonio J. Delgado 2022-10-17 14:53:02 +03:00
parent b5942017e2
commit f62e5d47c5
3 changed files with 25 additions and 5 deletions

View file

@ -2,8 +2,8 @@
Description=Filter mail
[Timer]
OnBootSec=5min
OnUnitActiveSec=5min
OnBootSec=10min
OnUnitActiveSec=10min
Unit=update_puppet_code.service
[Install]

View file

@ -123,4 +123,25 @@
file:
path: /etc/puppetlabs/code/environments/production
src: /etc/puppetlabs/code/environments/master
state: link
state: link
- name: Ensure service unit to update puppet code exists
template:
src: templates/update_puppet_code.service.j2
dest: /etc/systemd/system/update_puppet_code.service
mode: 0644
backup: yes
notify: Reload Systemd daemon
- name: Ensure timer unit to update puppet code exists
copy:
src: files/update_puppet_code.timer
dest: /etc/systemd/system/update_puppet_code.timer
mode: 0644
backup: yes
notify: Reload Systemd daemon
- name: Ensure service to update puppet code is enabled
service:
name: update_puppet_code
enabled: true

View file

@ -1,7 +1,6 @@
[Service]
Type=oneshot
WorkingDirectory=/etc/puppetlabs/code/environments/production
ExecStart=git pull
ExecStart=r10k deploy environment -p --config /etc/puppetlabs/r10k/r10k.yaml
[Unit]
OnFailure=status_email_antoniodelgado@%n.service