Execution
Date
08 Dec 2025 13:27:39 +0000
Duration
00:05:33.94
Controller
aio1.openstack.local
User
root
Versions
Ansible
2.18.6
ara
1.7.4 / 1.7.4
Python
3.12.3
Summary
2
Hosts
316
Tasks
313
Results
18
Plays
136
Files
0
Records
File: /home/zuul/src/opendev.org/openstack/openstack-ansible-openstack_hosts/tasks/configure_metal_hosts.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | --- # Copyright 2017, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - name: Check Kernel Version ansible.builtin.fail: msg: > Wrong kernel Version found [ {{ ansible_facts['kernel'] }} < {{ openstack_host_required_kernel }} ] Resolve this issue before continuing. when: - ansible_facts['kernel'] is version(openstack_host_required_kernel, '<') - name: Install distro packages for bare metal nodes ansible.builtin.package: name: "{{ openstack_host_metal_distro_packages }}" state: "{{ openstack_hosts_package_state }}" register: install_packages until: install_packages is success retries: 5 delay: 2 - name: Install user defined extra distro packages for bare metal nodes ansible.builtin.package: name: "{{ openstack_host_extra_metal_distro_packages }}" state: "{{ openstack_hosts_package_state }}" when: - openstack_host_extra_metal_distro_packages | length > 0 register: install_packages until: install_packages is success retries: 5 delay: 2 - name: Check how kernel modules are implemented (statically builtin, dynamic, not set) ansible.builtin.slurp: src: "/boot/config-{{ ansible_facts['kernel'] }}" register: modules when: - openstack_host_specific_kernel_modules | length > 0 - name: Fail fast if we can't load a module ansible.builtin.fail: msg: "{{ item.pattern }} is not set" with_items: "{{ openstack_host_specific_kernel_modules }}" when: - item.pattern is defined - (modules.content | b64decode).find(item.pattern + ' is not set') != -1 - name: "Load kernel module(s)" vars: _kernel_module_state: "{{ (item.condition | default(true)) | ternary('present', 'absent') }}" community.general.modprobe: name: "{{ item.name }}" state: "{{ _kernel_module_state }}" persistent: "{{ _kernel_module_state }}" params: "{{ item.params | default(omit) }}" with_items: "{{ openstack_host_kernel_modules + openstack_host_specific_kernel_modules }}" when: - item.name | length > 0 - item.pattern is undefined or (item.pattern is defined and (modules.content | b64decode).find(item.pattern + '=m') != -1) notify: - Update initramfs - name: Blacklist kernel modules ansible.builtin.copy: content: |- {% for module in openstack_host_blacklist_kernel_modules %} blacklist {{ module }} {% endfor %} dest: /etc/modprobe.d/blacklist-openstack-ansible.conf mode: "0644" owner: root group: root notify: - Update initramfs # TODO: Remove after 2026.1 release - name: Clean-up ex-default modules location ansible.builtin.lineinfile: path: /etc/modules line: "{{ item.name }}" state: absent loop: "{{ openstack_host_kernel_modules + openstack_host_specific_kernel_modules }}" when: - ansible_facts['os_family'] | lower == 'debian' - item.name | length > 0 # TODO: Remove after 2026.1 release - name: Remove ex-default modules location ansible.builtin.file: path: /etc/modules-load.d/openstack-ansible.conf state: absent - name: Adding new system tuning ansible.posix.sysctl: name: "{{ item.key }}" value: "{{ item.value }}" sysctl_set: "{{ item.set | default('yes') }}" sysctl_file: "{{ openstack_hosts_sysctl_file }}" state: "{{ item.state | default('present') }}" reload: false with_items: "{{ openstack_kernel_options + openstack_user_kernel_options }}" failed_when: false - name: Configure GRUB ansible.builtin.include_tasks: openstack_grub.yml when: - openstack_host_custom_grub_options | length > 0 - name: Configure sysstat ansible.builtin.include_tasks: openstack_sysstat.yml when: - openstack_host_sysstat_enabled | bool - name: Create a directory to hold systemd journals on disk ansible.builtin.file: path: /var/log/journal state: directory owner: root group: systemd-journal mode: "2755" register: journald_directory when: - openstack_host_keep_journals | bool # NOTE(mhayden): The linter is skipped here since the command does not create # any files. The command ensures that proper permissions and SELinux contests # are set. - name: Create tmpfiles structure in journald directory command: systemd-tmpfiles --create --prefix /var/log/journal when: - journald_directory is changed - openstack_host_keep_journals | bool notify: - Restart systemd-journald tags: - skip_ansible_lint |