2021-08-07 17:09:20 -05:00
|
|
|
#!/usr/bin/env ansible-playbook
|
|
|
|
# vim:ft=ansible:
|
|
|
|
---
|
|
|
|
- hosts: tags_ansible-pull
|
2022-02-15 15:19:34 -06:00
|
|
|
gather_facts: no
|
2021-08-07 17:09:20 -05:00
|
|
|
roles:
|
|
|
|
- role: ansible-pull
|
2021-08-23 23:25:02 -05:00
|
|
|
vars:
|
|
|
|
ansible_pull_repo: "https://git.desu.ltd/salt/ansible"
|
|
|
|
ansible_pull_commit: master
|
2021-08-07 17:09:20 -05:00
|
|
|
tags: [ ansible ]
|
|
|
|
- role: git
|
|
|
|
vars:
|
|
|
|
git_repos:
|
|
|
|
- repo: "{{ ansible_pull_repo }}"
|
|
|
|
dest: /etc/ansible
|
|
|
|
tags: [ ansible ]
|
|
|
|
- hosts: all
|
2022-02-15 15:19:34 -06:00
|
|
|
gather_facts: no
|
2021-08-07 17:09:20 -05:00
|
|
|
tasks:
|
|
|
|
- name: disable ansible-pull when not tagged
|
2022-06-16 23:45:29 -05:00
|
|
|
ansible.builtin.systemd: name={{ item }} state=stopped enabled=no
|
2021-08-07 17:09:20 -05:00
|
|
|
with_items:
|
|
|
|
- ansible-pull.timer
|
|
|
|
- ansible-pull.service
|
|
|
|
when: "'tags_ansible-pull' not in group_names and item in services"
|
|
|
|
tags: [ ansible ]
|