|
1 | 1 | ---
|
2 | 2 |
|
3 | 3 | - name: install centos software collections
|
4 |
| - package: |
| 4 | + yum: |
5 | 5 | name: centos-release-scl-rh
|
6 | 6 | state: present
|
| 7 | + update_cache: true |
7 | 8 | register: network_access
|
8 | 9 | until: network_access is success
|
9 |
| - retries: 10 |
| 10 | + retries: 3 |
10 | 11 | delay: 2
|
11 | 12 | when:
|
12 | 13 | - collections_enabled|bool
|
|
30 | 31 | - name: Set git
|
31 | 32 | set_fact:
|
32 | 33 | base_git: git
|
33 |
| - when: |
34 |
| - - ansible_os_family == 'RedHat' |
35 |
| - - ansible_distribution_major_version|int > 7 |
36 | 34 | tags:
|
37 | 35 | - git
|
38 | 36 | - base_git
|
| 37 | + - test |
39 | 38 |
|
40 | 39 | - name: Set git
|
41 | 40 | set_fact:
|
42 | 41 | base_git: rh-git218
|
43 | 42 | when:
|
44 | 43 | - ansible_os_family == 'RedHat'
|
45 | 44 | - ansible_distribution_major_version|int == 7
|
| 45 | + - collections_enabled|bool |
46 | 46 | tags:
|
47 | 47 | - git
|
48 | 48 | - base_git
|
| 49 | + - test |
49 | 50 |
|
50 | 51 | - name: Set git
|
51 | 52 | set_fact:
|
52 | 53 | base_git: rh-git29
|
53 | 54 | when:
|
54 | 55 | - ansible_os_family == 'RedHat'
|
55 | 56 | - ansible_distribution_major_version|int == 6
|
| 57 | + - collections_enabled|bool |
56 | 58 | tags:
|
57 | 59 | - git
|
58 | 60 | - base_git
|
| 61 | + - test |
59 | 62 |
|
60 | 63 | - name: Set git packages
|
61 | 64 | when: collections_enabled|bool and ansible_os_family == 'RedHat'
|
|
94 | 97 | stat:
|
95 | 98 | path: "/opt/rh/{{ base_git }}/enable"
|
96 | 99 | register: rh_git_env
|
| 100 | + tags: |
| 101 | + - test |
97 | 102 |
|
98 | 103 | - name: Enable Git software collection
|
99 | 104 | file:
|
|
107 | 112 | tags:
|
108 | 113 | - git
|
109 | 114 | - base_git
|
110 |
| - - notest |
| 115 | + - test |
111 | 116 |
|
112 | 117 | - name: Disable Git software collection
|
113 | 118 | file:
|
114 | 119 | path: /etc/profile.d/rh-git.sh
|
115 | 120 | state: absent
|
116 |
| - when: not collections_enabled|bool and ansible_os_family == 'RedHat' |
| 121 | + when: collections_enabled|bool and ansible_os_family == 'RedHat' |
117 | 122 | tags:
|
118 | 123 | - git
|
119 | 124 | - notest
|
120 | 125 |
|
121 |
| -- name: Disable Git software collection |
122 |
| - file: |
123 |
| - path: /etc/profile.d/rh-git.sh |
124 |
| - state: absent |
125 |
| - when: not collections_enabled|bool and ansible_os_family == 'RedHat' |
126 |
| - tags: |
127 |
| - - git |
128 |
| - |
129 | 126 | - name: Install Git
|
130 | 127 | become: true
|
131 | 128 | package:
|
|
140 | 137 | - git
|
141 | 138 | - base_git
|
142 | 139 |
|
| 140 | +- name: Collect git version |
| 141 | + command: bash --login -c 'git --version' |
| 142 | + register: git_version |
| 143 | + changed_when: false |
| 144 | + tags: |
| 145 | + - test |
| 146 | + |
| 147 | +- name: Display git version |
| 148 | + debug: |
| 149 | + msg: "{{ base_git }} {{ git_version.stdout }}" |
| 150 | + tags: |
| 151 | + - test |
| 152 | + |
143 | 153 | - name: Disable Git software collection
|
144 | 154 | file:
|
145 | 155 | path: /etc/profile.d/rh-git.sh
|
|
0 commit comments