git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/ansible/git-out.yml
blob: 2e5e2c44d837c095040597d8a44a3a5eacbf0981 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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_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)
    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)
    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"