ansible/playbooks/ansible-pull.yml

23 lines
588 B
YAML
Executable File

#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
---
- hosts: tags_ansible-pull
roles:
- role: ansible-pull
tags: [ ansible ]
- role: git
vars:
git_repos:
- repo: "{{ ansible_pull_repo }}"
dest: /etc/ansible
tags: [ ansible ]
- hosts: all
tasks:
- name: disable ansible-pull when not tagged
systemd: name={{ item }} state=stopped enabled=no
with_items:
- ansible-pull.timer
- ansible-pull.service
when: "'tags_ansible-pull' not in group_names and item in services"
tags: [ ansible ]