2 - name: Configuration to be applied before rebooting the node
7 # Kernel Args Configuration
9 - name: Ensure the kernel args ( {{ _KERNEL_ARGS_ }} ) is present as TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS
11 dest: /etc/default/grub
12 regexp: '^TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS.*'
13 insertafter: '^GRUB_CMDLINE_LINUX.*'
14 line: 'TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS=" {{ _KERNEL_ARGS_ }} "'
15 - name: Add TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS to the GRUB_CMDLINE_LINUX parameter
17 dest: /etc/default/grub
18 line: 'GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX:+$GRUB_CMDLINE_LINUX }${TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS}"'
19 insertafter: '^TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS.*'
20 - name: Generate grub config file
21 command: grub2-mkconfig -o /boot/grub2/grub.cfg
23 when: _KERNEL_ARGS_|default("") != ""
25 # Tune-d Configuration
27 - name: Tune-d Configuration
29 dest: /etc/tuned/cpu-partitioning-variables.conf
30 regexp: '^isolated_cores=.*'
31 line: 'isolated_cores={{ _HOST_CPUS_LIST_ }}'
32 when: _HOST_CPUS_LIST_|default("") != ""
34 - name: Tune-d provile activation
35 shell: tuned-adm profile {{ _TUNED_PROFILE_NAME_ }}
37 when: _TUNED_PROFILE_NAME_|default("") != ""
39 # Provisioning Network workaround
40 # The script will be executed before os-net-config, in which case, only Provisioning network will have IP
41 # BOOTPROTO of all interface config files (except provisioning), will be set to "none" to avoid reboot failing to acquire IP on other networks
44 paths: /etc/sysconfig/network-scripts/
49 dest: "{{ item.path }}"
50 regexp: '^BOOTPROTO=.*'
51 replace: 'BOOTPROTO=none'
53 - item.path | regex_replace('(^.*ifcfg-)(.*)', '\\2') != "lo"
54 # This condition will list all the interfaces except the one with valid IP (which is Provisioning network at this stage)
55 # Simpler Version - hostvars[inventory_hostname]['ansible_' + iface_name ]['ipv4']['address'] is undefined
56 - hostvars[inventory_hostname]['ansible_' + item.path | regex_replace('(^.*ifcfg-)(.*)', '\\2') ]['ipv4']['address'] is undefined
58 - "{{ ifcfg_files.files }}"