Skip to content

Commit 1140787

Browse files
committed
Small improvement in crc-cloud role
Added improvements: - the generated ssh pub key is also added to the authorized keys because of the machineconfig - export the KUBECONFIG variable, due it was changed to the local variable [1], so the oc command were failing with exit code 1. More info [2]. - set realpath for log file [1] crc-org/crc-cloud#189 [2] crc-org/crc-cloud#191 Change-Id: I8ef8cf2a7742cb396671ebcfa7b8d585730158f4
1 parent 555ddb1 commit 1140787

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Diff for: roles/prepare-crc-cloud/tasks/pre.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@
9393
dest: ~core/id_rsa.pub
9494
remote_src: true
9595

96+
- name: Copy generated pub key to authorized keys
97+
ansible.builtin.copy:
98+
src: ~core/.ssh/id_rsa.pub
99+
dest: ~core/.ssh/authorized_keys.d/generated
100+
remote_src: true
101+
96102
- name: Inject pull secret into /var/lib/kubelet/config.json
97103
become: true
98104
ansible.builtin.copy:

Diff for: roles/prepare-crc-cloud/tasks/start.yaml

+3-5
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,18 @@
55
#!/bin/bash
66
77
# Waiting for merge: https://github.com/crc-org/crc-cloud/pull/189
8-
export LOG_PATH="~core/workdir/"
8+
export LOG_PATH="$(realpath ~core/workdir)"
99
export LOG_FILE="$LOG_PATH/clustersetup-log"
1010
11+
export KUBECONFIG=/opt/kubeconfig
12+
1113
export PULL_SECRET="{{ crc_secret_pabrodri.openshift_pull_secret | b64encode }}"
1214
export PASS_DEVELOPER="{{ developer_pass }}"
1315
export PASS_KUBEADMIN="{{ kubeadmin_pass }}"
1416
export PASS_REDHAT="{{ redhat_pass }}"
1517
export IIP="{{ ansible_default_ipv4.address }}"
1618
export EIP="{{ crc_hostname }}"
1719
18-
# Workaround for openshift-marketplace and openshift-console container pull error
19-
# https://github.com/danpawlik/crc-cloud/commits/global-pull-secret/
20-
export GLOBAL_SECURED_REGISTRIES=true
21-
2220
sudo -E bash ~core/workdir/crc-cloud/pkg/bundle/setup/clustersetup.sh > ~core/workdir/crc-cloud-log 2> ~core/workdir/crc-cloud-error-log
2321
dest: ~core/workdir/start-crc-cloud.sh
2422
mode: "0755"

0 commit comments

Comments
 (0)