Merge "Use cinder_service_setup_host for qos and types creation"

This commit is contained in:
Zuul 2020-09-21 08:55:51 +00:00 committed by Gerrit Code Review
commit dbb1aaf434
4 changed files with 12 additions and 11 deletions

View File

@ -301,7 +301,6 @@ cinder_pip_packages:
- osprofiler
- PyMySQL
- pymemcache
- python-openstackclient
- python-memcached
- systemd-python

View File

@ -40,12 +40,13 @@
shell: |
. {{ ansible_env.HOME }}/openrc
CLI_OPTIONS="{{ ((keystone_service_adminuri_insecure | bool) or (cinder_service_internaluri_insecure | bool)) | ternary('--insecure','') }}"
if ! {{ cinder_bin }}/openstack ${CLI_OPTIONS} volume type show "{{ item.key }}"; then
{{ cinder_bin }}/openstack ${CLI_OPTIONS} volume type create --property volume_backend_name="{{ item.value.volume_backend_name }}" {% if not (item.value.public | default(True)) | bool %} --private {% endif %} "{{ item.key }}"
if ! {{ cinder_service_setup_host_python_interpreter | dirname }}/openstack ${CLI_OPTIONS} volume type show "{{ item.key }}"; then
{{ cinder_service_setup_host_python_interpreter | dirname }}/openstack ${CLI_OPTIONS} volume type create --property volume_backend_name="{{ item.value.volume_backend_name }}" {% if not (item.value.public | default(True)) | bool %} --private {% endif %} "{{ item.key }}"
fi
args:
executable: /bin/bash
with_dict: "{{ _cinder_backends|default({}) }}"
delegate_to: "{{ cinder_service_setup_host }}"
changed_when: false
- name: Add extra cinder volume types
@ -53,13 +54,14 @@
. {{ ansible_env.HOME }}/openrc
CLI_OPTIONS="{{ ((keystone_service_adminuri_insecure | bool) or (cinder_service_internaluri_insecure | bool)) | ternary('--insecure','') }}"
{% for evtype in item.value.extra_volume_types %}
if ! {{ cinder_bin }}/openstack ${CLI_OPTIONS} volume type show "{{ evtype }}"; then
{{ cinder_bin }}/openstack ${CLI_OPTIONS} volume type create --property volume_backend_name="{{ item.value.volume_backend_name }}" {% if not (item.value.public | default(True)) | bool %} --private {% endif %} "{{ evtype }}"
if ! {{ cinder_service_setup_host_python_interpreter | dirname }}/openstack ${CLI_OPTIONS} volume type show "{{ evtype }}"; then
{{ cinder_service_setup_host_python_interpreter | dirname }}/openstack ${CLI_OPTIONS} volume type create --property volume_backend_name="{{ item.value.volume_backend_name }}" {% if not (item.value.public | default(True)) | bool %} --private {% endif %} "{{ evtype }}"
fi
{% endfor %}
args:
executable: /bin/bash
with_dict: "{{ _cinder_backends|default({}) }}"
delegate_to: "{{ cinder_service_setup_host }}"
when: item.value.extra_volume_types is defined
- import_tasks: cinder_qos.yml

View File

@ -17,13 +17,14 @@
shell: |
. {{ ansible_env.HOME }}/openrc
CLI_OPTIONS="{{ ((keystone_service_adminuri_insecure | bool) or (cinder_service_internaluri_insecure | bool)) | ternary('--insecure','') }}"
{{ cinder_bin }}/openstack ${CLI_OPTIONS} volume qos list --format value --column Name | grep -x {{ item.name }} || \
{{ cinder_bin }}/openstack ${CLI_OPTIONS} volume qos create {{ item.name }} \
{{ cinder_service_setup_host_python_interpreter | dirname }}/openstack ${CLI_OPTIONS} volume qos list --format value --column Name | grep -x {{ item.name }} || \
{{ cinder_service_setup_host_python_interpreter | dirname }}/openstack ${CLI_OPTIONS} volume qos create {{ item.name }} \
--consumer {{ item.options.consumer }}\
{% for k,v in item.options.items() %} --property {{ k }}={{ v }}{% endfor %}
args:
executable: /bin/bash
with_items: "{{ cinder_qos_specs }}"
delegate_to: "{{ cinder_service_setup_host }}"
changed_when: false
tags:
- cinder-qos
@ -33,13 +34,14 @@
. {{ ansible_env.HOME }}/openrc
CLI_OPTIONS="{{ ((keystone_service_adminuri_insecure | bool) or (cinder_service_internaluri_insecure | bool)) | ternary('--insecure','') }}"
{% for vtype in item.cinder_volume_types %}
if {{ cinder_bin }}/openstack ${CLI_OPTIONS} volume type show "{{ vtype }}"; then
{{ cinder_bin }}/openstack ${CLI_OPTIONS} volume qos associate {{ item.name }} {{ vtype }}
if {{ cinder_service_setup_host_python_interpreter | dirname }}/openstack ${CLI_OPTIONS} volume type show "{{ vtype }}"; then
{{ cinder_service_setup_host_python_interpreter | dirname }}/openstack ${CLI_OPTIONS} volume qos associate {{ item.name }} {{ vtype }}
fi
{% endfor %}
args:
executable: /bin/bash
with_items: "{{ cinder_qos_specs }}"
delegate_to: "{{ cinder_service_setup_host }}"
when:
- item.cinder_volume_types is defined
tags:

View File

@ -31,8 +31,6 @@ cinder_distro_packages:
cinder_service_distro_packages:
- python3-cinder
- python3-openstackclient
- python3-shade
- python3-systemd
cinder_devel_distro_packages: