From a84c6ee664c15481b92a84b50172c85d37c6191f Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Tue, 13 Jul 2021 13:13:40 +0200 Subject: =?UTF-8?q?initiale=20=C3=BCberweisung=20diesdas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ansible/git-out.yml | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 ansible/git-out.yml (limited to 'ansible/git-out.yml') diff --git a/ansible/git-out.yml b/ansible/git-out.yml new file mode 100644 index 0000000..30c2d7e --- /dev/null +++ b/ansible/git-out.yml @@ -0,0 +1,49 @@ +--- +# "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_distibution*" + - 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" -- cgit v1.2.3