Modularize ansible-pull a bit

This commit is contained in:
Salt 2020-06-25 02:16:06 -05:00
parent e2cee3a6fa
commit 1b618daf54
3 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,6 @@
#!/usr/bin/ansible-playbook
# vim:ft=ansible:
ansible_pull_repo: "https://git.9iron.club/salt/ansible"
user_username: salt
zerotier_network_id: !vault |
$ANSIBLE_VAULT;1.1;AES256

View File

@ -7,7 +7,7 @@ User=ansible
Group=ansible
Type=oneshot
Environment=ANSIBLE_CONFIG=~/ansible-pull-repo/ansible-pull.cfg
ExecStart=/usr/local/bin/ansible-pull --accept-host-key -U "https://git.9iron.club/salt/ansible" -d "~/ansible-pull-repo" --vault-password-file "~/ansiblevaultpass" site.yml
ExecStart=/usr/local/bin/ansible-pull --accept-host-key -U "{{ ansible_pull_repo }}" -d "~/ansible-pull-repo" --vault-password-file "~/ansiblevaultpass" "{{ ansible_pull_playbook }}"
[Install]
WantedBy=multi-user.target

View File

@ -4,8 +4,8 @@ Description=Ansible pull timer
[Timer]
Persistent=true
OnBootSec=15min
OnUnitActiveSec=4h
OnBootSec={{ ansible_pull_boot_delay }}
OnUnitActiveSec={{ ansible_pull_frequency }}
[Install]
WantedBy=timers.target