Skip to content

Commit

Permalink
Do not enable/start ansible-pull unless explicitly set
Browse files Browse the repository at this point in the history
  • Loading branch information
Debilski committed Aug 14, 2024
1 parent 6c856b1 commit df88241
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
5 changes: 4 additions & 1 deletion all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
hosts: all

roles:
- ansible-pull
- role: ansible-pull
vars:
ansible_pull_timer_enabled: true
ansible_pull_timer_started: true
- common

- name: ASPP user setup
Expand Down
3 changes: 3 additions & 0 deletions roles/ansible-pull/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
ansible_pull_timer_started: false
ansible_pull_timer_enabled: false
34 changes: 18 additions & 16 deletions roles/ansible-pull/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,30 +87,32 @@
Environment=ANSIBLE_CALLBACK_PLUGINS=/usr/lib/python3.12/site-packages/ara/plugins/callback
tags: remote

- name: Enable ansible-pull-init.timer manually
ansible.builtin.file:
src: /usr/local/lib/systemd/system/ansible-pull-init.timer
dest: /etc/systemd/system/multi-user.target.wants/ansible-pull-init.timer
state: link

- name: Enable ansible-pull-repeat.timer manually
ansible.builtin.file:
src: /usr/local/lib/systemd/system/ansible-pull-repeat.timer
dest: /etc/systemd/system/multi-user.target.wants/ansible-pull-repeat.timer
state: link

- name: Enable ansible-pull-init.timer
ansible.builtin.systemd_service:
name: ansible-pull-init.timer
enabled: true
state: started
enabled: "{{ ansible_pull_timer_enabled }}"
daemon_reload: true
tags: remote

- name: Enable ansible-pull-repeat.timer
ansible.builtin.systemd_service:
name: ansible-pull-repeat.timer
enabled: "{{ ansible_pull_timer_enabled }}"
daemon_reload: true
tags: remote


- name: Enable ansible-pull-init.timer
ansible.builtin.systemd_service:
name: ansible-pull-init.timer
state: "started"
tags: remote
when: ansible_pull_timer_started

- name: Enable ansible-pull-repeat.timer
ansible.builtin.systemd_service:
name: ansible-pull-repeat.timer
enabled: true
state: started
state: "started"
daemon_reload: true
tags: remote
when: ansible_pull_timer_started

0 comments on commit df88241

Please sign in to comment.