|
8 | 8 | until: network_access is success |
9 | 9 | retries: 10 |
10 | 10 | delay: 2 |
11 | | - when: collections_enabled|bool and ansible_distribution == 'CentOS' |
| 11 | + when: |
| 12 | + - collections_enabled|bool |
| 13 | + - ansible_distribution == 'CentOS' |
| 14 | + - ansible_distribution_major_version|int <= 7 |
12 | 15 | tags: |
13 | 16 | - git |
14 | 17 | - base_git |
15 | 18 |
|
16 | 19 | - name: enable rhel software collections |
17 | 20 | # yamllint disable-line rule:line-length |
18 | 21 | command: "yum-config-manager --enable rhel-server-rhscl-{{ ansible_distribution_major_version }}-rpms" |
19 | | - when: collections_enabled|bool and ansible_distribution == 'RedHat' |
| 22 | + when: |
| 23 | + - collections_enabled|bool |
| 24 | + - ansible_distribution == 'RedHat' |
| 25 | + - ansible_distribution_major_version|int <= 7 |
20 | 26 | tags: |
21 | 27 | - git |
22 | 28 | - base_git |
23 | 29 |
|
24 | 30 | - name: Set git |
25 | 31 | set_fact: |
26 | | - base_git: rh-git29 |
| 32 | + base_git: git |
27 | 33 | when: |
28 | 34 | - ansible_os_family == 'RedHat' |
29 | | - - ansible_distribution_major_version|int == 6 |
| 35 | + - ansible_distribution_major_version|int > 7 |
30 | 36 | tags: |
31 | 37 | - git |
32 | 38 | - base_git |
|
41 | 47 | - git |
42 | 48 | - base_git |
43 | 49 |
|
| 50 | +- name: Set git |
| 51 | + set_fact: |
| 52 | + base_git: rh-git29 |
| 53 | + when: |
| 54 | + - ansible_os_family == 'RedHat' |
| 55 | + - ansible_distribution_major_version|int == 6 |
| 56 | + tags: |
| 57 | + - git |
| 58 | + - base_git |
| 59 | + |
44 | 60 | - name: Set git packages |
45 | 61 | when: collections_enabled|bool and ansible_os_family == 'RedHat' |
46 | 62 | set_fact: |
|
56 | 72 |
|
57 | 73 | - name: Install Git software collection |
58 | 74 | become: true |
59 | | - when: collections_enabled|bool and ansible_os_family == 'RedHat' |
| 75 | + when: |
| 76 | + - collections_enabled|bool |
| 77 | + - ansible_os_family == 'RedHat' |
| 78 | + - ansible_distribution_major_version|int <= 7 |
60 | 79 | yum: |
61 | 80 | name: "{{ base_git_rpms }}" |
62 | 81 | state: present |
|
88 | 107 | tags: |
89 | 108 | - git |
90 | 109 | - base_git |
91 | | - - notest |
| 110 | +# - notest |
92 | 111 |
|
93 | 112 | - name: Disable Git software collection |
94 | 113 | file: |
|
107 | 126 | tags: |
108 | 127 | - git |
109 | 128 |
|
110 | | -- name: Install Git from yum repo |
111 | | - become: true |
112 | | - # yamllint disable-line rule:line-length |
113 | | - when: (ansible_os_family == 'RedHat') and (not collections_enabled|bool or rhgit_install is failed) |
114 | | - yum: |
115 | | - name: git |
116 | | - state: present |
117 | | - update_cache: true |
118 | | - register: network_access |
119 | | - until: network_access is success |
120 | | - retries: 10 |
121 | | - delay: 2 |
122 | | - tags: |
123 | | - - git |
124 | | - - base_git |
125 | | - |
126 | | -- name: Install Git from apt repo |
| 129 | +- name: Install Git |
127 | 130 | become: true |
128 | | - when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' |
129 | | - apt: |
| 131 | + package: |
130 | 132 | name: git |
131 | 133 | state: present |
132 | 134 | update_cache: true |
|
0 commit comments