Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manila share type: do not fail if share exists #2173

Merged
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
29 changes: 25 additions & 4 deletions hooks/playbooks/manila_create_default_resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,33 @@
- name: Create Manila resources needed for tempest run
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
gather_facts: false
vars:
share_type_name: "default"
driver_handles_share_servers: "False"
extra_specs:
snapshot_support: "True"
create_share_from_snapshot_support: "True"
tasks:
- name: Creat share type default for manila tempest plugin tests
- name: Create share type default for manila tempest plugin tests
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
ansible.builtin.shell: |
ansible.builtin.command: |
oc -n {{ namespace }} exec -it pod/openstackclient \
-- openstack share type create default false \
--snapshot-support True --create-share-from-snapshot-support True
-- openstack share type create {{ share_type_name }} {{ driver_handles_share_servers }}
register: _manila_share_creation
failed_when: >-
( ( _manila_share_creation.rc | int ) != 0 )
and not ( "HTTP 409" in _manila_share_creation.stderr )

- name: Update default share type properties
environment:
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
PATH: "{{ cifmw_path }}"
vars:
# convert dict to 'k=v ...' format
extra_spec_opt: "{%- for k, v in extra_specs.items() -%}{{ k }}={{ v }} {% endfor -%}"
when: extra_spec_opt | length > 0
ansible.builtin.command: |
oc -n {{ namespace }} exec -it pod/openstackclient \
-- openstack share type set {{ share_type_name }} --extra-specs {{ extra_spec_opt }}
Loading