aboutsummaryrefslogtreecommitdiffstats
path: root/extraconfig/pre_network/ansible_host_config.ansible
diff options
context:
space:
mode:
authorSaravanan KR <skramaja@redhat.com>2017-03-17 21:45:54 +0530
committerSaravanan KR <skramaja@redhat.com>2017-06-13 11:02:33 +0530
commit0c66118b10c6988a5287edd9082a6ef577fc4f56 (patch)
tree54ce813ea5d32eeccdc075aeed7a11bf1b430e75 /extraconfig/pre_network/ansible_host_config.ansible
parent9a319d42b6c5092d1863e7018afee3eb42b9d6ed (diff)
Modify PreNetworkConfig config inline with role-specific parameters
Existing host_config_and_reboot.role.j2.yaml is done in ocata to configure kernel args. This can be enhanced with use of role-specific parameters, which is done in the current patch. The earlier method is deprecated and will be removed in Q releae. Implements: blueprint ovs-2-6-dpdk Change-Id: Ib864f065527167a49a0f60812d7ad4ad12c836d1
Diffstat (limited to 'extraconfig/pre_network/ansible_host_config.ansible')
-rw-r--r--extraconfig/pre_network/ansible_host_config.ansible58
1 files changed, 0 insertions, 58 deletions
diff --git a/extraconfig/pre_network/ansible_host_config.ansible b/extraconfig/pre_network/ansible_host_config.ansible
deleted file mode 100644
index c126c1a1..00000000
--- a/extraconfig/pre_network/ansible_host_config.ansible
+++ /dev/null
@@ -1,58 +0,0 @@
----
-- name: Configuration to be applied before rebooting the node
- connection: local
- hosts: localhost
-
- tasks:
- # Kernel Args Configuration
- - block:
- - name: Ensure the kernel args ( {{ _KERNEL_ARGS_ }} ) is present as TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS
- lineinfile:
- dest: /etc/default/grub
- regexp: '^TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS.*'
- insertafter: '^GRUB_CMDLINE_LINUX.*'
- line: 'TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS=" {{ _KERNEL_ARGS_ }} "'
- - name: Add TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS to the GRUB_CMDLINE_LINUX parameter
- lineinfile:
- dest: /etc/default/grub
- line: 'GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX:+$GRUB_CMDLINE_LINUX }${TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS}"'
- insertafter: '^TRIPLEO_HEAT_TEMPLATE_KERNEL_ARGS.*'
- - name: Generate grub config file
- command: grub2-mkconfig -o /boot/grub2/grub.cfg
- become: true
- when: _KERNEL_ARGS_|default("") != ""
-
- # Tune-d Configuration
- - block:
- - name: Tune-d Configuration
- lineinfile:
- dest: /etc/tuned/cpu-partitioning-variables.conf
- regexp: '^isolated_cores=.*'
- line: 'isolated_cores={{ _HOST_CPUS_LIST_ }}'
- when: _HOST_CPUS_LIST_|default("") != ""
-
- - name: Tune-d provile activation
- shell: tuned-adm profile {{ _TUNED_PROFILE_NAME_ }}
- become: true
- when: _TUNED_PROFILE_NAME_|default("") != ""
-
- # Provisioning Network workaround
- # The script will be executed before os-net-config, in which case, only Provisioning network will have IP
- # BOOTPROTO of all interface config files (except provisioning), will be set to "none" to avoid reboot failing to acquire IP on other networks
- - block:
- - find:
- paths: /etc/sysconfig/network-scripts/
- patterns: ifcfg-*
- register: ifcfg_files
-
- - replace:
- dest: "{{ item.path }}"
- regexp: '^BOOTPROTO=.*'
- replace: 'BOOTPROTO=none'
- when:
- - item.path | regex_replace('(^.*ifcfg-)(.*)', '\\2') != "lo"
- # This condition will list all the interfaces except the one with valid IP (which is Provisioning network at this stage)
- # Simpler Version - hostvars[inventory_hostname]['ansible_' + iface_name ]['ipv4']['address'] is undefined
- - hostvars[inventory_hostname]['ansible_' + item.path | regex_replace('(^.*ifcfg-)(.*)', '\\2') ]['ipv4']['address'] is undefined
- with_items:
- - "{{ ifcfg_files.files }}"