{"id":870,"sha1":"f404d61efbb0424a1bf7872701076b332e0612ef","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 2023, Cleura AB.\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- name: Fetch the list of already existing images\n  openstack.cloud.image_info:\n    cloud: \"{{ openstack_resources_cloud_name }}\"\n    interface: \"{{ openstack_resources_interface }}\"\n  when:\n    - openstack_resources_image['images'] | selectattr('checksum', 'defined')\n    - not (openstack_resources_image['image_force_upload'] | default(false))\n  register: existing_images\n\n- name: Upload images\n  ansible.builtin.include_tasks:\n    file: image_upload.yml\n  loop: \"{{ images_for_upload | batch(openstack_resources_image['image_upload_batch'] | default(3)) }}\"\n  loop_control:\n    loop_var: images\n    label: \"{{ images_for_upload | map(attribute='name') | to_json }}\"\n  vars:\n    existing_images_checksums: \"{{ existing_images['images'] | default([]) | map(attribute='checksum') }}\"\n    images_for_upload: >-\n      {{\n        (openstack_resources_image['image_force_upload'] | default(false)) | ternary(\n          openstack_resources_image['images'],\n          openstack_resources_image['images'] | selectattr('checksum', 'defined') | rejectattr('checksum', 'in', existing_images_checksums) +\n          openstack_resources_image['images'] | rejectattr('checksum', 'defined')\n        )\n      }}\n\n- name: Retrieve fresh details about controlled OpenStack images\n  openstack.cloud.image_info:\n    cloud: \"{{ openstack_resources_cloud_name }}\"\n    interface: \"{{ openstack_resources_interface }}\"\n    filters:\n      \"name\": \"{{ image['name'] }}\"\n  register: available_images\n  loop: \"{{ openstack_resources_image['images'] | rejectattr('checksum', 'undefined') }}\"\n  loop_control:\n    loop_var: image\n    label: \"name={{ image['name'] }}\"\n\n- name: Define images to rotate\n  ansible.builtin.set_fact:\n    images_to_rotate: |-\n      {% set image_rotate = {} %}\n      {% for image_result in available_images['results'] %}\n      {%   set _ = image_rotate.update({\n             image_result['image']['name']: image_result['images'] | rejectattr('checksum', 'eq', image_result['image']['checksum'])\n           })\n      %}\n      {% endfor %}\n      {{ image_rotate }}\n\n- name: Looping over images to rotate\n  ansible.builtin.include_tasks:\n    file: image_rotate.yml\n  loop: \"{{ available_images['results'] | map(attribute='image') }}\"\n  loop_control:\n    loop_var: image\n    label: \"{{ image['name'] }}\"\n  when:\n    - images_to_rotate[image['name']] | length > 0\n","created":"2025-12-08T14:14:50.229253Z","updated":"2025-12-08T14:14:50.229300Z","path":"/etc/ansible/ansible_collections/openstack/osa/roles/openstack_resources/tasks/image.yml"}