diff --git a/defaults/main.yml b/defaults/main.yml index 10d1ca7c..44b5e96d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -301,7 +301,6 @@ cinder_pip_packages: - osprofiler - PyMySQL - pymemcache - - python-openstackclient - python-memcached - systemd-python diff --git a/tasks/cinder_backends.yml b/tasks/cinder_backends.yml index af82c085..d2f01124 100644 --- a/tasks/cinder_backends.yml +++ b/tasks/cinder_backends.yml @@ -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 diff --git a/tasks/cinder_qos.yml b/tasks/cinder_qos.yml index eed27424..df61d277 100644 --- a/tasks/cinder_qos.yml +++ b/tasks/cinder_qos.yml @@ -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: diff --git a/vars/debian.yml b/vars/debian.yml index de675225..cc8abf3a 100644 --- a/vars/debian.yml +++ b/vars/debian.yml @@ -31,8 +31,6 @@ cinder_distro_packages: cinder_service_distro_packages: - python3-cinder - - python3-openstackclient - - python3-shade - python3-systemd cinder_devel_distro_packages: