Skip to content

Commit 398867b

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 398867b

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,41 @@
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+
41+
- name: Check if FIPS is enabled
42+
ansible.builtin.command: grep -q 1 /proc/sys/crypto/fips_enabled
43+
register: fips_check
44+
changed_when: false
45+
failed_when: false
46+
47+
- name: Check if openshift-install binary exists
48+
ansible.builtin.stat:
49+
path: "/usr/local/bin/openshift-install"
50+
register: binary_check
51+
52+
- name: Remove openshift-install binary when FIPS is enabled
53+
ansible.builtin.file:
54+
path: "/usr/local/bin/openshift-install"
55+
state: absent
56+
when:
57+
- fips_check.rc == 0 # FIPS is enabled (returns 1 when enabled)
58+
- binary_check.stat.exists
59+
60+
- name: Link openshift-install-fips to openshift-install
61+
file:
62+
src: "/usr/local/bin/openshift-install-fips"
63+
dest: "/usr/local/bin/openshift-install"
64+
state: link
65+
when:
66+
- fips_check.rc == 0 # FIPS is enabled (returns 1 when enabled)
67+
- binary_check.stat.exists
68+
3469
- name: Create pull-secret file
3570
when: not enable_local_registry
3671
copy:

0 commit comments

Comments
 (0)