File tree Expand file tree Collapse file tree
collection/stages/roles/day2ops/tasks/procedures Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010 name : shiftstack.stages.prepare
1111 tasks_from : app_creds.yml
1212
13- - name : Rotate OpenShift Cloud Credentials
13+ - name : Create clouds.yaml copy with cloud renamed for OCP secret
1414 ansible.builtin.shell : |
1515 set -o pipefail && \
16- cat {{ clouds_yaml_file_path }} | sed 's/{{ user_cloud }}:/openstack:/' | \
17- oc set data -n kube-system secret/openstack-credentials clouds.yaml=-
16+ cat {{ clouds_yaml_file_path }} | sed '/^---$/d' | sed 's/{{ user_cloud }}:/openstack:/' > /tmp/clouds_for_ocp.yaml
17+ changed_when : false
18+
19+ - name : Rotate OpenShift Cloud Credentials
20+ ansible.builtin.shell : |
21+ oc set data -n kube-system secret/openstack-credentials clouds.yaml="$(cat /tmp/clouds_for_ocp.yaml)"
1822 environment :
1923 KUBECONFIG : " {{ kubeconfig }}"
2024 changed_when : true
2125
26+ - name : Clean up temporary file
27+ ansible.builtin.file :
28+ path : /tmp/clouds_for_ocp.yaml
29+ state : absent
30+
2231- name : Get OpenStack Credentials from OCP cluster
2332 ansible.builtin.shell : |
2433 set -o pipefail && \
You can’t perform that action at this time.
0 commit comments