2020-06-17 08:52:28 -05:00
|
|
|
#!/usr/bin/ansible-playbook
|
|
|
|
# vim:ft=ansible:
|
|
|
|
---
|
|
|
|
- name: Set up ansible-pull
|
|
|
|
block:
|
|
|
|
- name: Copy Ansible password file
|
|
|
|
copy:
|
|
|
|
src: ansiblevaultpass
|
|
|
|
dest: ~/ansiblevaultpass
|
|
|
|
mode: "0600"
|
|
|
|
become: yes
|
|
|
|
become_user: ansible
|
|
|
|
- name: Template out services
|
|
|
|
template:
|
|
|
|
src: "{{ item.src }}"
|
|
|
|
dest: "{{ item.dest }}"
|
|
|
|
mode: "{{ item.mode }}"
|
|
|
|
loop:
|
|
|
|
- { src: "ansible-pull.service", dest: "/etc/systemd/system/ansible-pull.service", mode: "0644" }
|
|
|
|
- { src: "ansible-pull.timer", dest: "/etc/systemd/system/ansible-pull.timer", mode: "0644" }
|
2020-06-17 09:03:47 -05:00
|
|
|
notify: restart ansiblepull timer
|
2020-06-17 08:52:28 -05:00
|
|
|
- name: Enable timer
|
|
|
|
systemd:
|
|
|
|
daemon_reload: yes
|
|
|
|
name: ansible-pull.timer
|
|
|
|
enabled: yes
|
|
|
|
state: started
|
|
|
|
become: yes
|