git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/ansible/git-out.yml
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/git-out.yml')
-rw-r--r--ansible/git-out.yml49
1 files changed, 49 insertions, 0 deletions
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"