{"id":105,"sha1":"0b1a3bca6ed34f73ed7a22c3995950b8e45063bf","playbook":{"id":2,"items":{"plays":18,"tasks":608,"results":2412,"hosts":15,"files":158,"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-08T13:40:18.992997Z","ended":"2025-12-08T13:50:25.791366Z","duration":"00:10:06.798369","name":null,"ansible_version":"2.18.6","client_version":"1.7.4","python_version":"3.12.11","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- name: Check Kernel Version\n  ansible.builtin.fail:\n    msg: >\n      Wrong kernel Version found\n      [ {{ ansible_facts['kernel'] }} < {{ openstack_host_required_kernel }} ]\n      Resolve this issue before continuing.\n  when:\n    - ansible_facts['kernel'] is version(openstack_host_required_kernel, '<')\n\n- name: Install distro packages for bare metal nodes\n  ansible.builtin.package:\n    name: \"{{ openstack_host_metal_distro_packages }}\"\n    state: \"{{ openstack_hosts_package_state }}\"\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 for bare metal nodes\n  ansible.builtin.package:\n    name: \"{{ openstack_host_extra_metal_distro_packages }}\"\n    state: \"{{ openstack_hosts_package_state }}\"\n  when:\n    - openstack_host_extra_metal_distro_packages | length > 0\n  register: install_packages\n  until: install_packages is success\n  retries: 5\n  delay: 2\n\n- name: Check how kernel modules are implemented (statically builtin, dynamic, not set)\n  ansible.builtin.slurp:\n    src: \"/boot/config-{{ ansible_facts['kernel'] }}\"\n  register: modules\n  when:\n    - openstack_host_specific_kernel_modules | length > 0\n\n- name: Fail fast if we can't load a module\n  ansible.builtin.fail:\n    msg: \"{{ item.pattern }} is not set\"\n  with_items: \"{{ openstack_host_specific_kernel_modules }}\"\n  when:\n    - item.pattern is defined\n    - (modules.content | b64decode).find(item.pattern + ' is not set') != -1\n\n- name: \"Load kernel module(s)\"\n  vars:\n    _kernel_module_state: \"{{ (item.condition | default(true)) | ternary('present', 'absent') }}\"\n  community.general.modprobe:\n    name: \"{{ item.name }}\"\n    state: \"{{ _kernel_module_state }}\"\n    persistent: \"{{ _kernel_module_state }}\"\n    params: \"{{ item.params | default(omit) }}\"\n  with_items: \"{{ openstack_host_kernel_modules + openstack_host_specific_kernel_modules }}\"\n  when:\n    - item.name | length > 0\n    - item.pattern is undefined or (item.pattern is defined and (modules.content | b64decode).find(item.pattern + '=m') != -1)\n  notify:\n    - Update initramfs\n\n- name: Blacklist kernel modules\n  ansible.builtin.copy:\n    content: |-\n      {% for module in openstack_host_blacklist_kernel_modules %}\n      blacklist {{ module }}\n      {% endfor %}\n    dest: /etc/modprobe.d/blacklist-openstack-ansible.conf\n    mode: \"0644\"\n    owner: root\n    group: root\n  notify:\n    - Update initramfs\n\n# TODO: Remove after 2026.1 release\n- name: Clean-up ex-default modules location\n  ansible.builtin.lineinfile:\n    path: /etc/modules\n    line: \"{{ item.name }}\"\n    state: absent\n  loop: \"{{ openstack_host_kernel_modules + openstack_host_specific_kernel_modules }}\"\n  when:\n    - ansible_facts['os_family'] | lower == 'debian'\n    - item.name | length > 0\n\n# TODO: Remove after 2026.1 release\n- name: Remove ex-default modules location\n  ansible.builtin.file:\n    path: /etc/modules-load.d/openstack-ansible.conf\n    state: absent\n\n- name: Adding new system tuning\n  ansible.posix.sysctl:\n    name: \"{{ item.key }}\"\n    value: \"{{ item.value }}\"\n    sysctl_set: \"{{ item.set | default('yes') }}\"\n    sysctl_file: \"{{ openstack_hosts_sysctl_file }}\"\n    state: \"{{ item.state | default('present') }}\"\n    reload: false\n  with_items: \"{{ openstack_kernel_options + openstack_user_kernel_options }}\"\n  failed_when: false\n\n- name: Configure GRUB\n  ansible.builtin.include_tasks: openstack_grub.yml\n  when:\n    - openstack_host_custom_grub_options | length > 0\n\n- name: Configure sysstat\n  ansible.builtin.include_tasks: openstack_sysstat.yml\n  when:\n    - openstack_host_sysstat_enabled | bool\n\n- name: Create a directory to hold systemd journals on disk\n  ansible.builtin.file:\n    path: /var/log/journal\n    state: directory\n    owner: root\n    group: systemd-journal\n    mode: \"2755\"\n  register: journald_directory\n  when:\n    - openstack_host_keep_journals | bool\n\n# NOTE(mhayden): The linter is skipped here since the command does not create\n# any files. The command ensures that proper permissions and SELinux contests\n# are set.\n- name: Create tmpfiles structure in journald directory\n  command: systemd-tmpfiles --create --prefix /var/log/journal\n  when:\n    - journald_directory is changed\n    - openstack_host_keep_journals | bool\n  notify:\n    - Restart systemd-journald\n  tags:\n    - skip_ansible_lint\n","created":"2025-12-08T13:40:57.233759Z","updated":"2025-12-08T13:40:57.233771Z","path":"/home/zuul/src/opendev.org/openstack/openstack-ansible-openstack_hosts/tasks/configure_metal_hosts.yml"}