Delegate gnocchi retrievement task to setup host

Since we don't have required libraries on the swift hosts,
we should delegate openstack collection tasks to the setup host.

Depends-On: https://review.opendev.org/750321
Change-Id: Ib8a8875c1a355b1f67cdc2bc4f1d028fa7ae3496
(cherry picked from commit 5c1209e0ec8b20869bdf6eb4d0a4ebba02264fda)
This commit is contained in:
Dmitriy Rabotyagov 2020-08-26 15:50:25 +03:00 committed by Dmitriy Rabotyagov (noonedeadpunk)
parent 4917ab1614
commit d134e68491

View File

@ -13,25 +13,27 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
- name: Get Gnocchi project id - name: Define Gnocchi project id
openstack.cloud.os_project_info: delegate_to: "{{ swift_service_setup_host }}"
name: "{{ gnocchi_service_project_name }}" vars:
interface: "{{ keystone_service_adminurl }}" ansible_python_interpreter: "{{ swift_service_setup_host_python_interpreter }}"
verify: "{{ keystone_service_adminuri_insecure }}" block:
register: get_gnocchi_project - name: Get Gnocchi project id
until: get_gnocchi_project is success openstack.cloud.os_project_info:
retries: 5 name: "{{ gnocchi_service_project_name }}"
delay: 10 interface: "{{ keystone_service_adminurl }}"
when: verify: "{{ keystone_service_adminuri_insecure }}"
- swift_gnocchi_enabled | bool register: get_gnocchi_project
no_log: True until: get_gnocchi_project is success
retries: 5
delay: 10
no_log: True
- name: Store Gnocchi project id - name: Store Gnocchi project id
set_fact: set_fact:
swift_gnocchi_service_project_id: "{{ get_gnocchi_project.openstack_projects[0].id }}" swift_gnocchi_service_project_id: "{{ get_gnocchi_project.openstack_projects[0].id }}"
when: when:
- swift_gnocchi_enabled | bool - swift_gnocchi_enabled | bool
- get_gnocchi_project is success
- name: swift proxy server configuration - name: swift proxy server configuration
config_template: config_template: