21 lines
653 B
Django/Jinja
21 lines
653 B
Django/Jinja
[Unit]
|
|
Description=Ansible Pull GitOps Sync
|
|
Documentation=https://docs.ansible.com/ansible/latest/cli/ansible-pull.html
|
|
After=network-online.target
|
|
Wants=network-online.target
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
User=root
|
|
# Wir nutzen ansible-pull um das Repo zu holen und das lokale Playbook auszuführen
|
|
# -U: URL des Repos
|
|
# -d: Checkout Verzeichnis
|
|
# -i: Inventory (hier localhost)
|
|
# pull_deploy.yml: Das Playbook im Repo
|
|
ExecStart=/usr/bin/ansible-pull -U {{ git_repo_url }} -d /opt/stabify-infra -i /opt/stabify-infra/infrastructure/ansible/inventory_local.ini infrastructure/ansible/pull_deploy.yml
|
|
timeoutStartSec=600
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
|