ansible-pull(role): fix timestamp export permission issue
The successful run timestamp export didn't work, because the ansible-pull user wouldn't necessarily have the necessary permissions. Move the timestamp export as well as the reboot to separate services, which always run as root, to ensure these operations work.
This commit is contained in:
parent
f6f6cc4804
commit
9678f4dd83
1 changed files with 32 additions and 4 deletions
|
|
@ -51,7 +51,7 @@
|
|||
group: "{{ ansible_pull__user }}"
|
||||
become: true
|
||||
|
||||
- name: ensure systemd services exists
|
||||
- name: ensure templated systemd services exists
|
||||
ansible.builtin.template:
|
||||
src: "{{ item }}.j2"
|
||||
dest: "/etc/systemd/system/{{ item }}"
|
||||
|
|
@ -65,6 +65,20 @@
|
|||
notify:
|
||||
- systemd daemon reload
|
||||
|
||||
- name: ensure systemd services exists
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item }}"
|
||||
dest: "/etc/systemd/system/{{ item }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
become: true
|
||||
loop:
|
||||
- ansible-pull-reboot.service
|
||||
- ansible-pull-successful-run-timestamp-exporter.service
|
||||
notify:
|
||||
- systemd daemon reload
|
||||
|
||||
- name: ensure systemd timer exists
|
||||
ansible.builtin.template:
|
||||
src: ansible-pull.timer.j2
|
||||
|
|
|
|||
Loading…
Reference in a new issue