#!/usr/bin/env ansible-playbook # vim:ft=ansible: --- - hosts: tags_ansible-pull gather_facts: no roles: - role: ansible-pull vars: ansible_pull_repo: "https://git.desu.ltd/salt/ansible" ansible_pull_commit: master tags: [ ansible ] - role: git vars: git_repos: - repo: "{{ ansible_pull_repo }}" dest: /etc/ansible tags: [ ansible ] - hosts: all gather_facts: no 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 ]