{"id":742,"sha1":"01689a66c1c4590322f591a614a9f6133d02ed70","playbook":{"id":4,"items":{"plays":104,"tasks":1377,"results":1365,"hosts":2,"files":504,"records":0},"arguments":{"version":null,"verbosity":0,"private_key_file":null,"remote_user":null,"connection":"openstack.osa.ssh","timeout":null,"ssh_common_args":null,"sftp_extra_args":null,"scp_extra_args":null,"ssh_extra_args":null,"ask_pass":false,"connection_password_file":null,"force_handlers":true,"flush_cache":false,"become":false,"become_method":"sudo","become_user":null,"become_ask_pass":false,"become_password_file":null,"tags":["all"],"skip_tags":[],"check":false,"diff":false,"inventory":["/home/zuul/src/opendev.org/openstack/openstack-ansible/inventory/dynamic_inventory.py","/home/zuul/src/opendev.org/openstack/openstack-ansible/inventory/inventory.ini","/etc/openstack_deploy/inventory.ini"],"listhosts":false,"subset":null,"extra_vars":"Not saved by ARA as configured by 'ignored_arguments'","vault_ids":[],"ask_vault_pass":false,"vault_password_files":[],"forks":8,"module_path":null,"syntax":false,"listtasks":false,"listtags":false,"step":false,"start_at_task":null,"args":["setup-openstack.yml"]},"labels":[{"id":1,"name":"check:False"},{"id":2,"name":"tags:all"}],"started":"2025-12-08T13:39:52.478534Z","ended":"2025-12-08T14:14:54.510371Z","duration":"00:35:02.031837","name":null,"ansible_version":"2.18.6","client_version":"1.7.4","python_version":"3.12.3","server_version":"1.7.4","status":"failed","path":"/home/zuul/src/opendev.org/openstack/openstack-ansible/playbooks/setup-openstack.yml","controller":"aio1.openstack.local","user":"root"},"content":"---\n# Copyright 2014, Rackspace US, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n# We set the python interpreter to the ansible runtime venv if\n# the delegation is to localhost so that we get access to the\n# appropriate python libraries in that venv. If the delegation\n# is to another host, we assume that it is accessible by the\n# system python instead.\n\n- name: Ensure that all required variables are set when tempest_public_net_create is enabled\n  ansible.builtin.assert:\n    that:\n      - tempest_public_net_name is defined\n      - tempest_public_net_provider_type is defined\n      - tempest_public_net_physical_name is defined\n      - tempest_public_subnet_name is defined\n      - tempest_public_subnet_cidr is defined\n      - tempest_public_net_physical_name is defined\n      - tempest_public_router_external is defined\n  when:\n    - tempest_public_net_create\n\n- name: Ensure that all required variables are set when tempest_public_net_create is disabled\n  ansible.builtin.assert:\n    that:\n      - tempest_neutron_public_network_id is defined\n  when:\n    - not tempest_public_net_create\n\n- name: Ensure that all required variables are set when tempest_private_net_create is enabled\n  ansible.builtin.assert:\n    that:\n      - tempest_private_net_name is defined\n      - tempest_private_subnet_name is defined\n      - tempest_private_subnet_cidr is defined\n      - tempest_private_net_provider_type is defined\n  when:\n    - tempest_private_net_create\n\n- name: Ensure that all required variables are set when tempest_router_create is enabled\n  ansible.builtin.assert:\n    that:\n      - (tempest_public_net_create or tempest_neutron_public_network_id is defined)\n      - tempest_private_net_create\n  when:\n    - tempest_router_create\n\n- name: Ensure that all required variables are set when tempest_images_create is disabled\n  ansible.builtin.assert:\n    that:\n      - tempest_glance_image_id_1 is defined\n      - tempest_glance_image_id_2 is defined\n  when:\n    - not tempest_images_create\n\n- name: Ensure that all required variables are set when tempest_flavors_create is enabled\n  ansible.builtin.assert:\n    that:\n      - \"tempest_flavors | length > 0\"\n  when:\n    - tempest_flavors_create\n\n- name: Ensure that all required variables are set when tempest_flavors_create is disabled\n  ansible.builtin.assert:\n    that:\n      - tempest_nova_flavor_id_1 is defined\n  when:\n    - not tempest_flavors_create\n\n- name: Ensures you have at least one image to upload\n  ansible.builtin.assert:\n    that:\n      - \"tempest_images | length > 0\"\n  when:\n    - tempest_service_available_glance | bool\n    - tempest_images_create | bool\n\n- name: Creating OpenStack Projects\n  ansible.builtin.include_role:\n    name: openstack.osa.openstack_resources\n  vars:\n    openstack_resources_identity:\n      domains:\n        - name: \"{{ tempest_domain_name }}\"\n      projects: |-\n        {% set projects = [] %}\n        {% for project in tempest_projects %}\n        {%   set _ = projects.append({\n                'name': project,\n                'description': project ~ ' project',\n                'domain': tempest_domain_name\n        })  %}\n        {% endfor %}\n        {{ projects }}\n  when:\n    - tempest_projects_create | bool\n\n- name: Get tempest project data\n  delegate_to: \"{{ tempest_service_setup_host }}\"\n  run_once: true\n  vars:\n    ansible_python_interpreter: \"{{ tempest_service_setup_host_python_interpreter }}\"\n  block:\n    - name: Get tempest project UUID\n      openstack.cloud.project_info:\n        cloud: \"{{ tempest_cloud_name }}\"\n        interface: \"{{ tempest_interface_name }}\"\n        domain: \"{{ tempest_domain_name }}\"\n        name: \"{{ project }}\"\n      loop: \"{{ tempest_projects }}\"\n      loop_control:\n        loop_var: project\n        label: \"{{ project }}\"\n      register: tempest_project_details\n\n- name: Get demo project ID\n  ansible.builtin.set_fact:\n    keystone_demo_tenant_id: >-\n      {{ (tempest_project_details.results | map(attribute='projects') | list | flatten | map(attribute='id') | list)[0] }}\n\n- name: Creating OpenStack resources\n  ansible.builtin.include_role:\n    name: openstack.osa.openstack_resources\n  vars:\n    _private_network:\n      name: \"{{ tempest_private_net_name }}\"\n      network_type: \"{{ tempest_private_net_provider_type }}\"\n      physical_network: \"{{ tempest_private_net_physical_name | default(omit) }}\"\n      segmentation_id: \"{{ tempest_private_net_seg_id | default(omit) }}\"\n      mtu: \"{{ tempest_private_net_mtu | default(omit) }}\"\n      project: \"{{ keystone_demo_tenant_id }}\"\n      subnets:\n        - name: \"{{ tempest_private_subnet_name }}\"\n          cidr: \"{{ tempest_private_subnet_cidr }}\"\n          dhcp: false\n\n    _public_network:\n      name: \"{{ tempest_public_net_name }}\"\n      network_type: \"{{ tempest_public_net_provider_type }}\"\n      physical_network: \"{{ tempest_public_net_physical_name | default(omit) }}\"\n      segmentation_id: \"{{ tempest_public_net_seg_id | default(omit) }}\"\n      external: \"{{ tempest_public_router_external }}\"\n      project: \"{{ keystone_demo_tenant_id }}\"\n      shared: \"{{ tempest_public_net_shared }}\"\n      subnets:\n        - name: \"{{ tempest_public_subnet_name }}\"\n          cidr: \"{{ tempest_public_subnet_cidr }}\"\n          allocation_start: \"{{ tempest_public_subnet_allocation_pools.split('-')[0] | default(omit) }}\"\n          allocation_end: \"{{ tempest_public_subnet_allocation_pools.split('-')[1] | default(omit) }}\"\n          gateway: \"{{ tempest_public_subnet_gateway_ip | default(omit) }}\"\n\n    _router:\n      name: router\n      network: \"{{ tempest_public_net_name }}\"\n      interfaces:\n        - \"{{ tempest_private_subnet_name }}\"\n      project: \"{{ keystone_demo_tenant_id }}\"\n    _compute_resources:\n      flavors:\n        - specs: \"{{ tempest_flavors }}\"\n\n    _image_resources:\n      images: \"{{ tempest_images | default([]) }}\"\n\n    _network_resources: |-\n      {% set resources = {'networks': [], 'routers': [], 'security_groups': []} %}\n      {% if tempest_private_net_create | bool %}\n      {%   set _ = resources['networks'].append(_private_network) %}\n      {% endif %}\n      {% if tempest_public_net_create | bool %}\n      {%   set _ = resources['networks'].append(_public_network) %}\n      {% endif %}\n      {% if tempest_router_create | bool %}\n      {%   set _ = resources['routers'].append(_router) %}\n      {% endif %}\n      {{ resources }}\n    openstack_resources_setup_host: \"{{ tempest_service_setup_host }}\"\n    openstack_resources_python_interpreter: \"{{ tempest_service_setup_host_python_interpreter }}\"\n    openstack_resources_cloud_name: \"{{ tempest_cloud_name }}\"\n    openstack_resources_interface: \"{{ tempest_interface_name }}\"\n    openstack_resources_network: \"{{ tempest_service_available_neutron | ternary(_network_resources, {}) }}\"\n    openstack_resources_image: \"{{ (tempest_service_available_glance and tempest_images_create) | ternary(_image_resources, {}) }}\"\n    openstack_resources_compute: \"{{ (tempest_service_available_nova and tempest_flavors_create) | ternary(_compute_resources, {}) }}\"\n\n- name: Get tempest resources data\n  delegate_to: \"{{ tempest_service_setup_host }}\"\n  run_once: true\n  vars:\n    ansible_python_interpreter: \"{{ tempest_service_setup_host_python_interpreter }}\"\n  block:\n    - name: Get tempest images\n      openstack.cloud.image_info:\n        cloud: \"{{ tempest_cloud_name }}\"\n        interface: \"{{ tempest_interface_name }}\"\n        filters:\n          \"name\": \"{{ image['name'] }}\"\n          \"tags\":\n            - \"managed_by_tempest\"\n      loop: \"{{ tempest_images }}\"\n      loop_control:\n        loop_var: image\n        label: \"{{ image['name'] }}\"\n      register: tempest_image_details\n      when:\n        - tempest_service_available_glance | bool\n        - tempest_images_create | bool\n\n    - name: Get tempest public network UUID\n      openstack.cloud.networks_info:\n        cloud: \"{{ tempest_cloud_name }}\"\n        interface: \"{{ tempest_interface_name }}\"\n        name: \"{{ tempest_public_net_name }}\"\n        filters:\n          project_id: \"{{ keystone_demo_tenant_id }}\"\n      register: tempest_public_network_details\n      when:\n        - tempest_service_available_neutron | bool\n        - tempest_public_net_create | bool\n\n    - name: Get tempest router details\n      openstack.cloud.routers_info:\n        cloud: \"{{ tempest_cloud_name }}\"\n        interface: \"{{ tempest_interface_name }}\"\n        name: router\n        filters:\n          project_id: \"{{ keystone_demo_tenant_id }}\"\n      when:\n        - tempest_service_available_neutron | bool\n        - tempest_router_create | bool\n\n# These facts are used in tempest.conf.j2; we set an empty string if it is not\n# set above to ensure the template will parse correctly.\n- name: Store first tempest image id\n  vars:\n    res: \"{{ tempest_image_details['results'] | map(attribute='images') | flatten }}\"\n  ansible.builtin.set_fact:\n    tempest_glance_image_id_1: \"{{ res[0]['id'] | default('') }}\"\n    tempest_glance_image_id_2: \"{{ res[-1]['id'] | default('') }}\"\n  when:\n    - tempest_service_available_glance | bool\n    - tempest_images_create | bool\n\n- name: Store tempest flavor id\n  ansible.builtin.set_fact:\n    tempest_nova_flavor_id_1: \"{{ tempest_service_available_nova | ternary(tempest_flavors[0]['id'], '1') }}\"\n    tempest_nova_flavor_id_2: \"{{ tempest_service_available_nova | ternary(tempest_flavors[-1]['id'], '2') }}\"\n  when:\n    - tempest_service_available_nova | bool\n    - tempest_flavors_create | bool\n\n- name: Store neutron public network id\n  ansible.builtin.set_fact:\n    tempest_neutron_public_network_id: \"{{ tempest_service_available_neutron | ternary(tempest_public_network_details['networks'][0]['id'], '') }}\"\n  when:\n    - tempest_service_available_neutron | bool\n    - tempest_public_net_create | bool\n\n- name: Get router admin state and ip address\n  ansible.builtin.set_fact:\n    router_admin_state: \"{{ _add_router['routers'][0]['is_admin_state_up'] }}\"\n    router_ip: \"{{ _add_router['routers'][0]['external_gateway_info']['external_fixed_ips'][0]['ip_address'] }}\"\n  when:\n    - tempest_service_available_neutron | bool\n    - tempest_router_create | bool\n\n- name: Ping router ip address\n  ansible.builtin.shell: |\n    set -e\n    ping -c2 \"{{ router_ip }}\"\n  register: _ping_router\n  changed_when: false\n  until: _ping_router is success\n  retries: 5\n  delay: 10\n  when:\n    - tempest_router_create | bool\n    - tempest_service_available_neutron | bool\n    - router_admin_state | bool\n    - tempest_network_ping_gateway | bool\n    - tempest_public_net_provider_type not in ['local']\n","created":"2025-12-08T13:40:14.268834Z","updated":"2025-12-08T13:40:14.268861Z","path":"/home/zuul/src/opendev.org/openstack/openstack-ansible-os_tempest/tasks/tempest_resources.yml"}