Add automatic updater using ansible-pull
This commit is contained in:
parent
ecc2988b56
commit
f70f907206
3 changed files with 38 additions and 0 deletions
|
|
@ -190,6 +190,26 @@
|
|||
tags:
|
||||
- baseinstall
|
||||
|
||||
# Updater
|
||||
|
||||
- name: Provide services and timers for updater
|
||||
ansible.builtin.template:
|
||||
src: "{{ item }}.j2"
|
||||
dest: "/etc/systemd/system/{{ item }}"
|
||||
mode: '0644'
|
||||
loop:
|
||||
- lmn-updater.service
|
||||
- lmn-updater.timer
|
||||
when: misc_updater_repository | default(false) is truthy
|
||||
|
||||
- name: Enable updater.timer
|
||||
ansible.builtin.systemd:
|
||||
name: lmn-updater.timer
|
||||
enabled: true
|
||||
when:
|
||||
- misc_updater_repository | default(false) is truthy
|
||||
- misc_updater_autostart | default(false) is truthy
|
||||
|
||||
# Prepare CloneScreen on Presenter PCs
|
||||
|
||||
- name: Fix primary screen for class room PCs with projector
|
||||
|
|
|
|||
9
roles/lmn_misc/templates/lmn-updater.service.j2
Normal file
9
roles/lmn_misc/templates/lmn-updater.service.j2
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Run LMN Client updates via ansible-pull
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=root
|
||||
ExecStart=/usr/bin/ansible-pull --verbose --vault-password-file /root/.inventory-pw -l %H -d /root/lmn-client \
|
||||
-i {{ misc_updater_inventory }} --url={{ misc_updater_repository }} -C {{ misc_updater_branch }} lmn-client.yml
|
||||
|
||||
9
roles/lmn_misc/templates/lmn-updater.timer.j2
Normal file
9
roles/lmn_misc/templates/lmn-updater.timer.j2
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Run LMN Updater every day
|
||||
Requires=lmn-updater.service
|
||||
|
||||
[Timer]
|
||||
OnBootSec=5min
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
Loading…
Add table
Add a link
Reference in a new issue