Template out ansible-pull.cfg BEFORE first run

Turns out this caused serious problems if a host had never actually fully run ansible-pull before
This commit is contained in:
Salt 2020-10-26 18:36:49 -05:00
parent 19e8e7cfae
commit fd87cb00d0
3 changed files with 5 additions and 1 deletions

View File

@ -12,6 +12,10 @@
become_user: ansible
- name: Configure systemd unit
block:
- name: Template out config
template: src=ansible-pull.cfg dest=~/ansible-pull.cfg
become: yes
become_user: ansible
- name: Template out services
template:
src: "{{ item.src }}"

View File

@ -7,7 +7,7 @@ StartLimitBurst=5
[Service]
User=ansible
Group=ansible
Environment=ANSIBLE_CONFIG=~/ansible-pull-repo/ansible-pull.cfg
Environment=ANSIBLE_CONFIG=~/ansible-pull.cfg
ExecStart=/usr/local/bin/ansible-pull --accept-host-key -U "{{ ansible_pull_repo }}" -d "~/ansible-pull-repo" --vault-password-file "~/ansiblevaultpass" "{{ ansible_pull_playbook }}"
Restart=on-failure
RestartSec=90