diff --git a/ansible/roles/blazar/tasks/bootstrap.yml b/ansible/roles/blazar/tasks/bootstrap.yml index a0a09e580b..f6a24d6db6 100644 --- a/ansible/roles/blazar/tasks/bootstrap.yml +++ b/ansible/roles/blazar/tasks/bootstrap.yml @@ -33,28 +33,16 @@ when: - not use_preconfigured_databases | bool -# TODO(egonzalez) Use os_nova_host_aggregate ansible module once ansible min version is 2.3 -# http://docs.ansible.com/ansible/os_nova_host_aggregate_module.html - name: Creating blazar host aggregate become: true - command: > - docker exec kolla_toolbox openstack - --os-interface internal - --os-auth-url {{ openstack_auth.auth_url }} - --os-identity-api-version 3 - --os-project-domain-name {{ openstack_auth.domain_name }} - --os-project-name {{ openstack_auth.project_name }} - --os-username {{ openstack_auth.username }} - --os-password {{ openstack_auth.password }} - --os-user-domain-name {{ openstack_auth.user_domain_name }} - --os-region-name {{ openstack_region_name }} - {% if openstack_cacert != '' %}--os-cacert {{ openstack_cacert }}{% endif %} - aggregate create {{ blazar_aggregate_pool_name }} - register: blazar_host_aggregate - changed_when: blazar_host_aggregate is success - failed_when: - - blazar_host_aggregate.rc != 0 - - blazar_host_aggregate.stderr.find('already') == -1 + kolla_toolbox: + module_name: os_nova_host_aggregate + module_args: + auth: "{{ openstack_auth }}" + cacert: "{{ openstack_cacert }}" + endpoint_type: "{{ openstack_interface }}" + region_name: "{{ openstack_region_name }}" + name: "{{ blazar_aggregate_pool_name }}" run_once: True delegate_to: "{{ groups['blazar-api'][0] }}"