--- # "git out" for emergency scenario. The scenario consists of three steps: # 1. git commit # 2. git push # 3. git out - hosts: "{{ runtime_hosts | default('CHANGEME') }}" become: true gather_facts: false vars: binfiles: - files/git-out tasks: - name: Gather necessary facts setup: filter: "ansible_distribution*" - name: Trigger execution on Red Hat derivatives debug: msg: "{{ansible_distribution}}, checking in." changed_when: true notify: "redhat" when: ansible_distribution_file_variety == "RedHat" - name: Trigger execution on Debian derivatives debug: msg: "{{ansible_distribution}}, checking in." changed_when: true notify: "debian" when: ansible_distribution_file_variety == "Debian" handlers: - name: Copy essential binaries(tm) to {{ inventory_hostname }} copy: #src: "{{item.file}}" src: "files/git-out" dest: "/usr/libexec/git-core/git-out" mode: 0755 owner: root group: root #loop: "{{vars.binfiles}}" listen: "redhat" - name: Copy essential binaries(tm) to {{ inventory_hostname }} copy: #src: "{{item.file}}" src: "files/git-out" dest: "/usr/lib/git-core/git-out" mode: 0755 owner: root group: root #loop: "{{vars.binfiles}}" listen: "debian"