tripleo-heat-templates/extraconfig/pre_network/ansible_host_config.yaml
Tim Rozet b30bdb6f8e Adds service for OVS and enables ODL DPDK deployments
In order to deploy OpenDaylight with DPDK we need to copy the DPDK
config for OVS done in the neutron-ovs-dpdk service template, without
enabling OVS agent for compute nodes.  To do this correctly, we should
inherit and openvswitch service which is a common place to set OVS
configuration and parameters.  Note: vswitch::dpdk config will be called
in prenetwork setup with ovs_dpdk_config.yaml so there is no need to
include that in the step config for neutron-ovs-dpdk-agent service or
opendaylight-ovs-dpdk.

Changes Include:
 - Creates a common openvswitch service template, which in the future
   will migrate to be its own service.
 - Renames and fixes OVS DPDK configuration heat parameters in the
   openvswitch template.
 - neutron-ovs-dpdk-agent now inherits the common openvswitch template.
 - Adds opendaylight-ovs-dpdk template which also inherits common ovs
   template.
 - Uses OVS DPDK config script to allow configuring OVS DPDK in
   prenetwork config (before os-net-config runs).  This has an issue
   where hieradata is not present yet, so we have to redefine the heat
   parameters and pass them via bash.  In the future this should be
   corrected.
 - Adds opendaylight-dpdk environment file used to deploy an ODL + DPDK
   deployment.
 - Updates neutron-ovs-dpdk environment file.

Closes-Bug: 1656097
Partial-Bug: 1656096

Depends-On: I3227189691df85f265cf84bd4115d8d4c9f979f3

Change-Id: Ie80e38c2a9605d85cdf867a31b6888bfcae69e29
Signed-off-by: Tim Rozet <trozet@redhat.com>
2017-06-23 09:31:53 -04:00

59 lines
2.5 KiB
YAML

---
- 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={{ _TUNED_CORES_ }}'
when: _TUNED_CORES_|default("") != ""
- name: Tune-d profile 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'] is undefined
- hostvars[inventory_hostname]['ansible_' + item.path | regex_replace('(^.*ifcfg-)(.*)', '\\2') ]['ipv4'] is undefined
with_items:
- "{{ ifcfg_files.files }}"