ansible/roles/ansiblehost/tasks/main.yml

23 lines
684 B
YAML
Raw Normal View History

#!/usr/bin/ansible-playbook
# vim:ft=ansible:
---
- name: Set up system for Ansible
block:
- name: Copy Ansible password file
copy:
src: ansiblevaultpass
dest: /root/ansiblevaultpass
mode: "0600"
- name: Create system copy of Ansible repo
git:
repo: "https://gitlab.com/rehashedsalt/ansible"
dest: /opt/ansible-repo
update: yes
- name: Set up pull and run cronjob
cron:
minute: "0"
hour: "*/12"
name: ansible-pull
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"
become: true