Skip to content

Commit f049fd0

Browse files
committed
fix: when in fips mode and in a disconnected environment, remove the non fips openshift-install
Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
1 parent e1ae35b commit f049fd0

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

playbooks/roles/ocp-config/tasks/extract.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@
3131
args:
3232
chdir: "{{ tools_dir }}"
3333

34+
- name: Extract OCP4 tools from release image ( local-registry )
35+
when: enable_local_registry
36+
shell: |
37+
oc adm release extract --tools {{ release_image_override }} --registry-config='{{ ansible_env.HOME }}/.openshift/pull-secret-updated'
38+
args:
39+
chdir: "{{ tools_dir }}"
40+
3441
- name: Create pull-secret file
3542
when: not enable_local_registry
3643
copy:
@@ -57,6 +64,28 @@
5764
remote_src: yes
5865
with_items: "{{ find_result.files }}"
5966

67+
- name: Check if openshift-install binary exists
68+
ansible.builtin.stat:
69+
path: "/usr/local/bin/openshift-install"
70+
register: binary_check
71+
72+
- name: Remove openshift-install binary when FIPS is enabled
73+
ansible.builtin.file:
74+
path: "/usr/local/bin/openshift-install"
75+
state: absent
76+
when:
77+
- fips_compliant
78+
- binary_check.stat.exists
79+
80+
- name: Link openshift-install-fips to openshift-install
81+
file:
82+
src: "/usr/local/bin/openshift-install-fips"
83+
dest: "/usr/local/bin/openshift-install"
84+
state: link
85+
when:
86+
- fips_compliant # FIPS is enabled
87+
- binary_check.stat.exists
88+
6089
- name: Remove tools directory
6190
file:
6291
path: "{{ tools_dir }}"

0 commit comments

Comments
 (0)