Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,24 @@
name: shiftstack.stages.prepare
tasks_from: app_creds.yml

- name: Rotate OpenShift Cloud Credentials
- name: Create clouds.yaml copy with cloud renamed for OCP secret
ansible.builtin.shell: |
set -o pipefail && \
cat {{ clouds_yaml_file_path }} | sed 's/{{ user_cloud }}:/openstack:/' | \
oc set data -n kube-system secret/openstack-credentials clouds.yaml=-
cat {{ clouds_yaml_file_path }} | sed '/^---$/d' | sed 's/{{ user_cloud }}:/openstack:/' > /tmp/clouds_for_ocp.yaml
changed_when: false

- name: Rotate OpenShift Cloud Credentials
ansible.builtin.shell: |
oc set data -n kube-system secret/openstack-credentials clouds.yaml="$(cat /tmp/clouds_for_ocp.yaml)"
environment:
KUBECONFIG: "{{ kubeconfig }}"
changed_when: true

- name: Clean up temporary file
ansible.builtin.file:
path: /tmp/clouds_for_ocp.yaml
state: absent

- name: Get OpenStack Credentials from OCP cluster
ansible.builtin.shell: |
set -o pipefail && \
Expand Down
Loading