{"id":238,"sha1":"0dd1192b724d24f88ad081ee57d1a948adc65bd7","playbook":{"id":3,"items":{"plays":37,"tasks":374,"results":364,"hosts":2,"files":208,"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-infrastructure.yml"]},"labels":[{"id":1,"name":"check:False"},{"id":2,"name":"tags:all"}],"started":"2025-12-08T13:33:24.432723Z","ended":"2025-12-08T13:39:38.483304Z","duration":"00:06:14.050581","name":null,"ansible_version":"2.18.6","client_version":"1.7.4","python_version":"3.12.3","server_version":"1.7.4","status":"completed","path":"/home/zuul/src/opendev.org/openstack/openstack-ansible/playbooks/setup-infrastructure.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- name: Gather utility facts\n  hosts: utility_all\n  gather_facts: \"{{ osa_gather_facts | default(true) }}\"\n  module_defaults:\n    ansible.builtin.setup:\n      gather_subset: \"{{ osa_gather_subset | default(lookup('ansible.builtin.env', 'ANSIBLE_GATHER_SUBSET', default='!all,min')) }}\"\n  tags:\n    - always\n\n- name: Setup the utility location(s)\n  hosts: utility_all\n  user: root\n  gather_facts: false\n  serial: \"{{ utility_serial | default(['1', '100%']) }}\"\n  environment: \"{{ deployment_environment_variables | default({}) }}\"\n  vars:\n    utility_upper_constraints_url: \"{{ requirements_git_url | default('https://releases.openstack.org/constraints/upper/' ~\n                                                                       requirements_git_install_branch | default('master')) }}\"\n  tags:\n    - utility\n  handlers:\n    - name: Ensure bash completions directory is present\n      ansible.builtin.file:\n        path: \"/etc/bash_completion.d\"\n        state: \"directory\"\n        mode: \"0755\"\n      listen:\n        - \"venv changed\"\n    - name: Create openstack client bash_completion script # noqa: no-changed-when\n      ansible.builtin.shell: >-\n        openstack complete > /etc/bash_completion.d/openstack_client\n      args:\n        executable: /bin/bash\n      listen:\n        - \"venv changed\"\n  pre_tasks:\n    - name: Setup installation variables\n      ansible.builtin.include_role:\n        name: openstack.osa.install_defaults\n        defaults_from: \"{{ install_method }}\"\n        public: true\n\n    - name: Including container-setup role\n      ansible.builtin.include_role:\n        name: \"openstack.osa.{{ container_tech | default('lxc') }}_container_setup\"\n      when: not is_metal\n\n    - name: Including unbound-clients role\n      ansible.builtin.include_role:\n        name: openstack.osa.unbound_clients\n      when:\n        - hostvars['localhost']['resolvconf_enabled'] | bool\n\n    - name: Create log directory (not is_metal)\n      ansible.builtin.file:\n        dest: \"/var/log/utility\"\n        state: \"directory\"\n        force: \"yes\"\n        mode: \"0755\"\n      when: not is_metal | bool\n\n  roles:\n    - role: \"galera_server\"\n      vars:\n        galera_install_client: true\n        galera_install_server: false\n    - role: \"openstack_openrc\"\n      tags:\n        - openrc\n\n  post_tasks:\n    - name: Add OpenStack client to distro packages\n      ansible.builtin.set_fact:\n        utility_distro_packages: \"{{ (utility_distro_packages | default([])) + utility_distro_openstack_clients_packages }}\"\n      when: install_method == \"distro\"\n\n    - name: Install distro packages\n      ansible.builtin.package:\n        name: \"{{ utility_distro_packages | default([]) }}\"\n        state: \"{{ utility_package_state }}\"\n        update_cache: \"{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}\"\n        cache_valid_time: \"{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary(cache_timeout, omit) }}\"\n      register: install_packages\n      until: install_packages is success\n      retries: 5\n      delay: 2\n\n    - name: Distribute private ssh key\n      ansible.builtin.copy:\n        content: \"{{ utility_ssh_private_key }}\"\n        dest: /root/.ssh/id_rsa\n        mode: \"0600\"\n        owner: root\n        group: root\n      when: utility_ssh_private_key is defined\n\n    - name: Install openstack clients (source-based install)\n      when:\n        - install_method == \"source\"\n      block:\n        - name: Get list of repo packages\n          ansible.builtin.uri:\n            url: \"{{ utility_upper_constraints_url }}\"\n            return_content: true\n          register: _abs_reqs\n          check_mode: false\n          ignore_errors: \"{{ ansible_check_mode }}\"\n          retries: 5\n          delay: 3\n          until: _abs_reqs is succeeded\n          tags:\n            - always\n\n        - name: Derive the list of openstack clients\n          ansible.builtin.set_fact:\n            _openstack_client_list: >-\n              {%- set package_list = [] %}\n              {%- for l in _abs_reqs.content.split('\\n') %}\n              {%-   if (l is match('^python-.*client==.*$')) or\n                       (l is match('^(aodh|gnocchi)client==.*$')) or\n                       (l is match('^osc-placement==.*$'))\n              %}\n              {%-     set _ = package_list.append(l | regex_replace('==.*$', '')) %}\n              {%-   endif %}\n              {%- endfor %}\n              {{- package_list }}\n          run_once: true\n          tags:\n            - always\n\n        - name: Install the python venv\n          ansible.builtin.include_role:\n            name: \"python_venv_build\"\n          vars:\n            venv_python_executable: \"{{ utility_venv_python_executable | default(openstack_venv_python_executable) }}\"\n            venv_install_destination_path: \"{{ utility_venv_bin | dirname }}\"\n            venv_build_distro_package_list: \"{{ utility_devel_distro_packages }}\"\n            venv_pip_install_args: \"{{ pip_install_options | default('') }}\"\n            venv_build_constraints:\n              - \"--constraint {{ utility_upper_constraints_url }}\"\n            venv_pip_packages: \"{{ _openstack_client_list | union(utility_pip_packages) }}\"\n\n        - name: Create list of binaries to symlink\n          ansible.builtin.set_fact:\n            _openstack_client_to_symlink: |-\n              {%- set binary_list = [] %}\n              {%- for l in _openstack_client_list %}\n              {%-   set _ = binary_list.append(l | regex_replace('^(?:python-)?(\\w*)(?:client)$', '\\\\1')) %}\n              {%- endfor %}\n              {{- binary_list }}\n          run_once: true\n\n        - name: Create symlinks for openstack clients\n          ansible.builtin.file:\n            src: \"{{ utility_venv_bin }}/{{ item }}\"\n            path: \"/usr/local/bin/{{ item }}\"\n            state: link\n            force: true\n            follow: false\n          with_items:\n            - \"{{ _openstack_client_to_symlink }}\"\n          notify: \"Create openstack client bash_completion script\"\n","created":"2025-12-08T13:33:29.056032Z","updated":"2025-12-08T13:33:29.056068Z","path":"/etc/ansible/ansible_collections/openstack/osa/playbooks/utility_host.yml"}