ansible_pull(role): ensure role and collection dependencies are present

This commit is contained in:
June 2025-10-15 02:18:07 +02:00
commit 9afbc71801
Signed by: june
SSH key fingerprint: SHA256:o9EAq4Y9N9K0pBQeBTqhSDrND5E7oB+60ZNx0U1yPe0

View file

@ -7,6 +7,9 @@ OnFailure=ansible-pull-failure-notify.service
[Service]
Type=oneshot
Environment="SOPS_AGE_KEY_FILE=/etc/ansible_pull_secrets/age_private_key"
ExecStartPre=/usr/bin/bash -c 'if [ ! -e /home/chaos/ansible_pull_checkout ]; then git clone --depth 1 "{{ ansible_pull__repo_url }}" /home/chaos/ansible_pull_checkout ; fi'
ExecStartPre=/usr/local/lib/ansible_pull_venv/bin/ansible-galaxy role install -r /home/chaos/ansible_pull_checkout/requirements.yml
ExecStartPre=/usr/local/lib/ansible_pull_venv/bin/ansible-galaxy collection install -r /home/chaos/ansible_pull_checkout/requirements.yml
ExecStart=/usr/local/lib/ansible_pull_venv/bin/ansible-pull \
--directory /home/chaos/ansible_pull_checkout \
--clean \