Skip to content

Commit

Permalink
Fix multiattach volume type create playbook
Browse files Browse the repository at this point in the history
For uni* jobs none of the cifmw_install_yamls_* variables are set
as the deployment is done via devscripts role. This causes a
failure when executing the hook.

This patch sets the default value of the namespace to openstack.

Signed-off-by: Pragadeeswaran Sathyanarayanan <[email protected]>
  • Loading branch information
psathyan authored and openshift-merge-bot[bot] committed May 17, 2024
1 parent 9332a5c commit d249f0b
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions hooks/playbooks/cinder_multiattach_volume_type.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,27 @@
tasks:
- name: Set the multiattach volume type name
ansible.builtin.set_fact:
cifmw_volume_multiattach_type: "{{ cifmw_volume_multiattach_type|default('multiattach') }}"
cifmw_volume_multiattach_type: >-
{{
cifmw_volume_multiattach_type | default('multiattach')
}}
- name: Set a multiattach volume type and create it if needed
vars:
_namespace: >-
{{
cifmw_install_yamls_defaults['NAMESPACE'] | default('openstack')
}}
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
ansible.builtin.shell: |
oc -n {{ cifmw_install_yamls_defaults['NAMESPACE'] }} rsh openstackclient \
openstack volume type show {{ cifmw_volume_multiattach_type }} &>/dev/null || \
oc -n {{ cifmw_install_yamls_defaults['NAMESPACE'] }} rsh openstackclient \
openstack volume type create {{ cifmw_volume_multiattach_type }}
oc -n {{ cifmw_install_yamls_defaults['NAMESPACE'] }} rsh openstackclient \
openstack volume type set --property multiattach="<is> True" {{ cifmw_volume_multiattach_type }}
set -xe -o pipefail
oc project {{ _namespace }}
oc rsh openstackclient \
openstack volume type show {{ cifmw_volume_multiattach_type }} &>/dev/null || \
oc rsh openstackclient \
openstack volume type create {{ cifmw_volume_multiattach_type }}
oc rsh openstackclient \
openstack volume type set --property multiattach="<is> True" \
{{ cifmw_volume_multiattach_type }}

0 comments on commit d249f0b

Please sign in to comment.