{"id":103,"sha1":"14dbf0deabf68a5d90b39b9a19734ca7c45ede38","playbook":{"id":2,"items":{"plays":18,"tasks":603,"results":2357,"hosts":15,"files":157,"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":4,"module_path":null,"syntax":false,"listtasks":false,"listtags":false,"step":false,"start_at_task":null,"args":["setup-hosts.yml"]},"labels":[{"id":1,"name":"check:False"},{"id":2,"name":"tags:all"}],"started":"2025-12-14T10:04:43.190296Z","ended":"2025-12-14T10:14:53.851603Z","duration":"00:10:10.661307","name":null,"ansible_version":"2.18.6","client_version":"1.7.4","python_version":"3.13.5","server_version":"1.7.4","status":"completed","path":"/home/zuul/src/opendev.org/openstack/openstack-ansible/playbooks/setup-hosts.yml","controller":"aio1.openstack.local","user":"root"},"content":"---\n# Copyright 2017, 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# APT configuration tasks that apply on all nodes.\n\n- name: Ensure /etc/apt/sources.list.d exists\n  ansible.builtin.file:\n    path: /etc/apt/sources.list.d\n    state: directory\n    owner: root\n    group: root\n    mode: \"0755\"\n\n- name: Validate repo config is deb822 format\n  vars:\n    _repo_check: \"{{ openstack_hosts_package_repos | selectattr('repo', 'defined') | map(attribute='repo') }}\"\n  ansible.builtin.assert:\n    that: _repo_check | length == 0\n    fail_msg: \"The following repository definitions must be updated to deb822 format {{ _repo_check }}\"\n\n# NOTE(jrosser) remove this task for the 2025.2 release\n- name: Clean up legacy repository config not in deb822 format\n  vars:\n    openstack_hosts_apt_repo_cleanup:\n      - uca.list\n      - osbpo.list\n  ansible.builtin.file:\n    path: \"/etc/apt/sources.list.d/{{ item }}\"\n    state: absent\n  register: _cleanup_apt_repositories\n  with_items: \"{{ openstack_hosts_apt_repo_cleanup }}\"\n\n- name: Add requirement packages (repositories gpg keys, toolkits...)\n  ansible.builtin.apt:\n    name: \"{{ openstack_hosts_package_list | rejectattr('state', 'equalto', 'absent') | map(attribute='name') | list }}\"\n    state: \"{{ openstack_hosts_package_state }}\"\n    update_cache: true\n    cache_valid_time: \"{{ cache_timeout }}\"\n  register: _install_packages\n  until: _install_packages  is success\n  retries: 5\n  delay: 2\n\n- name: Manage apt repositories\n  ansible.builtin.deb822_repository:\n    allow_downgrade_to_insecure: \"{{ item.allow_downgrade_to_insecure | default(omit) }}\"\n    allow_insecure: \"{{ item.allow_insecure | default(omit) }}\"\n    allow_weak: \"{{ item.allow_weak | default(omit) }}\"\n    architectures: \"{{ item.architectures | default(omit) }}\"\n    by_hash: \"{{ item.by_hash | default(omit) }}\"\n    check_date: \"{{ item.check_date | default(omit) }}\"\n    check_valid_until: \"{{ item.check_valid_until | default(omit) }}\"\n    components: \"{{ item.components | default(omit) }}\"\n    date_max_future: \"{{ item.date_max_future | default(omit) }}\"\n    enabled: \"{{ item.enabled | default(omit) }}\"\n    inrelease_path: \"{{ item.inrelease_path | default(omit) }}\"\n    languages: \"{{ item.languages | default(omit) }}\"\n    mode: \"{{ item.mode | default(omit) }}\"\n    name: \"{{ item.name }}\"\n    pdiffs: \"{{ item.pdiffs | default(omit) }}\"\n    signed_by: \"{{ item.signed_by | default(omit) }}\"\n    state: \"{{ item.state | default(omit) }}\"\n    suites: \"{{ item.suites | default(omit) }}\"\n    targets: \"{{ item.targets | default(omit) }}\"\n    trusted: \"{{ item.trusted | default(omit) }}\"\n    types: \"{{ item.types | default(omit) }}\"\n    uris: \"{{ item.uris | default(omit) }}\"\n  loop: \"{{ openstack_hosts_package_repos }}\"\n  loop_control:\n    label: \"{{ loop_label | to_json }}\"\n  vars:\n    loop_label:\n      name: \"{{ item.name }}\"\n      uris: \"{{ item.uris | default('') }}\"\n      state: \"{{ item.state | default('present') }}\"\n      suites: \"{{ item.suites | default('') }}\"\n  register: _manage_apt_repositories\n\n- name: Add apt extra conf\n  ansible.builtin.copy:\n    content: \"{{ openstack_hosts_package_manager_default_conf + openstack_hosts_package_manager_extra_conf }}\"\n    dest: /etc/apt/apt.conf.d/99openstack-ansible\n    mode: \"0644\"\n  when:\n    - openstack_hosts_package_manager_extra_conf | length > 0 or openstack_hosts_package_manager_default_conf | length > 0\n\n- name: Update Apt cache\n  ansible.builtin.apt:\n    update_cache: true\n  when:\n    - (_manage_apt_repositories is changed) or (_cleanup_apt_repositories is changed)\n  register: _update_apt_cache\n  until: _update_apt_cache  is success\n  changed_when: false\n  retries: 5\n  delay: 2\n","created":"2025-12-14T10:05:16.288534Z","updated":"2025-12-14T10:05:16.288545Z","path":"/home/zuul/src/opendev.org/openstack/openstack-ansible-openstack_hosts/tasks/openstack_hosts_configure_apt.yml"}