{"id":39,"sha1":"839749bb39e0a19fe4643bfc32c79ab42dc3619c","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 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 variables for each operating system\n  ansible.builtin.include_vars: \"{{ lookup('first_found', params) }}\"\n  vars:\n    params:\n      files:\n        - \"{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_version'] | lower }}.yml\"\n        - \"{{ ansible_facts['distribution'] | lower }}-{{ ansible_facts['distribution_major_version'] | lower }}.yml\"\n        - \"{{ ansible_facts['os_family'] | lower }}-{{ ansible_facts['distribution_major_version'] | lower }}.yml\"\n        - \"{{ ansible_facts['distribution'] | lower }}.yml\"\n        - \"{{ ansible_facts['os_family'] | lower }}.yml\"\n      paths:\n        - \"{{ role_path }}/vars\"\n  tags:\n    - always\n\n- name: Allow the usage of local facts\n  ansible.builtin.file:\n    path: /etc/ansible/facts.d/\n    state: directory\n    mode: \"0755\"\n  tags:\n    - openstack_hosts-install\n\n# Deploy the release file everywhere\n- name: Importing openstack_release tasks\n  ansible.builtin.import_tasks: openstack_release.yml\n  tags:\n    - openstack_hosts-install\n\n# Proxy configuration applies to all nodes\n- name: Add global_environment_variables to environment file\n  ansible.builtin.blockinfile:\n    dest: \"/etc/environment\"\n    state: present\n    marker: \"# {mark} Managed by OpenStack-Ansible\"\n    insertbefore: EOF\n    block: \"{{ lookup('template', 'environment.j2') }}\"\n  tags:\n    - openstack_hosts-config\n\n- name: Create systemd global directory\n  ansible.builtin.file:\n    path: /etc/systemd/system.conf.d/\n    state: directory\n    owner: \"root\"\n    group: \"root\"\n    mode: \"0755\"\n\n- name: Add DefaultEnvironment to systemd\n  openstack.config_template.config_template:\n    src: systemd-environment.j2\n    dest: /etc/systemd/system.conf.d/osa-default-environment.conf\n    owner: \"root\"\n    group: \"root\"\n    mode: \"0644\"\n    config_overrides: \"{{ openstack_systemd_global_overrides }}\"\n    config_type: ini\n  notify: Systemd daemon reload\n\n- name: Remove the blacklisted packages\n  ansible.builtin.package:\n    name: \"{{ openstack_hosts_package_list | selectattr('state', 'equalto', 'absent') | map(attribute='name') | list }}\"\n    state: absent\n\n# This allows to include this role to get all the distro\n# specific configuration for all the nodes.\n# It is also used for installing common packages to\n# all nodes\n- name: Apply package management distro specific configuration\n  ansible.builtin.include_tasks: \"openstack_hosts_configure_{{ ansible_facts['pkg_mgr'] | lower }}.yml\"\n\n# Configure bare metal nodes: Kernel, sysctl, sysstat, hosts files, metal packages\n- name: Including configure_metal_hosts tasks\n  ansible.builtin.include_tasks: configure_metal_hosts.yml\n  args:\n    apply:\n      tags:\n        - openstack_hosts-install\n  when:\n    - is_metal\n  tags:\n    - always\n\n- name: Ensure environment is applied during sudo\n  ansible.builtin.lineinfile:\n    path: /etc/pam.d/sudo\n    line: \"session    required   pam_env.so readenv=1 user_readenv=0\"\n    regexp: \"session\\\\s+required\\\\s+pam_env\\\\.so\"\n    insertbefore: \"^@include\"\n  when: ansible_facts['distribution'] | lower == 'debian'\n\n# Configure host files should apply to all nodes\n- name: Configure etc hosts files\n  ansible.builtin.include_tasks: openstack_update_hosts_file.yml\n  args:\n    apply:\n      tags:\n        - openstack_hosts-config\n        - openstack_hosts-file\n  when:\n    - (openstack_host_manage_hosts_file | bool) or (openstack_host_manage_deploy_hosts_file | bool)\n  tags:\n    - always\n\n- name: Decreasing tcp_retries2 sysctl\n  ansible.posix.sysctl:\n    name: \"net.ipv4.tcp_retries2\"\n    value: \"{{ keepalived_sysctl_tcp_retries | default(8) }}\"\n    sysctl_set: true\n    sysctl_file: \"{{ openstack_hosts_sysctl_file }}\"\n    state: \"{{ (keepalived_sysctl_tcp_retries | default(8) > 0) | ternary('present', 'absent') }}\"\n    reload: true\n  failed_when: false\n\n- name: Install distro packages\n  ansible.builtin.package:\n    name: \"{{ openstack_host_distro_packages }}\"\n    state: \"{{ openstack_hosts_package_state }}\"\n  when:\n    - openstack_host_distro_packages | length > 0\n  register: install_packages\n  until: install_packages is success\n  retries: 5\n  delay: 2\n\n- name: Install user defined extra distro packages\n  ansible.builtin.package:\n    name: \"{{ openstack_host_extra_distro_packages }}\"\n    state: \"{{ openstack_hosts_package_state }}\"\n  when:\n    - openstack_host_extra_distro_packages | length > 0\n  register: install_packages\n  until: install_packages is success\n  retries: 5\n  delay: 2\n\n- name: Importing openstack_authorized_keys tasks\n  ansible.builtin.import_tasks: openstack_authorized_keys.yml\n  tags:\n    - openstack_hosts-config\n\n- name: Including PKI role\n  ansible.builtin.include_role:\n    name: pki\n    tasks_from: main_ca_install.yml\n    apply:\n      tags:\n        - pki\n  vars:\n    pki_authorities: \"{{ openstack_pki_authorities | default([]) }}\"\n    pki_dir: \"{{ openstack_pki_dir }}\"\n    pki_install_ca: \"{{ openstack_pki_install_ca | default([]) + openstack_host_ca_certificates }}\"\n  tags:\n    - always\n\n- name: Including openstack_gitconfig tasks\n  ansible.builtin.include_tasks: openstack_gitconfig.yml\n  args:\n    apply:\n      tags:\n        - openstack_hosts-config\n\n- name: Including openstack_hosts_systemd tasks\n  ansible.builtin.include_tasks: openstack_hosts_systemd.yml\n  args:\n    apply:\n      tags:\n        - openstack_hosts-config\n        - openstack_hosts-systemd\n  when:\n    - openstack_hosts_systemd_networkd_devices or\n      openstack_hosts_systemd_networkd_networks or\n      openstack_hosts_systemd_services or\n      openstack_hosts_systemd_mounts or\n      openstack_hosts_journald_config\n  tags:\n    - always\n","created":"2025-12-14T10:04:44.036648Z","updated":"2025-12-14T10:04:44.036660Z","path":"/home/zuul/src/opendev.org/openstack/openstack-ansible-openstack_hosts/tasks/main.yml"}