2019-09-15 00:39:47 -05:00
|
|
|
#!/usr/bin/ansible-playbook
|
|
|
|
# vim:ft=ansible:
|
|
|
|
---
|
2020-02-06 00:32:31 -06:00
|
|
|
- name: Set up system for Ansible
|
2020-02-06 00:38:04 -06:00
|
|
|
block:
|
2020-02-14 15:40:31 -06:00
|
|
|
- name: Copy Ansible password file
|
|
|
|
copy:
|
|
|
|
src: ansiblevaultpass
|
|
|
|
dest: /root/ansiblevaultpass
|
|
|
|
mode: "0600"
|
2020-02-06 00:32:31 -06:00
|
|
|
- name: Create system copy of Ansible repo
|
|
|
|
git:
|
2020-04-30 13:26:16 -05:00
|
|
|
repo: "https://git.9iron.club/salt/ansible"
|
2020-02-06 00:32:31 -06:00
|
|
|
dest: /opt/ansible-repo
|
2020-04-22 22:55:37 -05:00
|
|
|
update: yes
|
2020-02-06 00:32:31 -06:00
|
|
|
- name: Set up pull and run cronjob
|
|
|
|
cron:
|
2020-02-11 14:43:25 -06:00
|
|
|
minute: "0"
|
|
|
|
hour: "*/12"
|
2020-02-06 00:32:31 -06:00
|
|
|
name: ansible-pull
|
2020-03-21 22:29:36 -05:00
|
|
|
job: "cd /opt/ansible-repo && HOME=/root /usr/local/bin/ansible-playbook \"{{ pullplaybook }}\" --vault-password-file /root/ansiblevaultpass > /var/log/ansible-pull.log 2>&1"
|
2019-09-15 00:39:47 -05:00
|
|
|
become: true
|