From d0702e82b5cc6d535e986f6f4435975cc0a42c93 Mon Sep 17 00:00:00 2001
From: Saravanan KR <skramaja@redhat.com>
Date: Thu, 2 Nov 2017 15:20:06 +0530
Subject: [PATCH] Add a tag to all the role specific parameters

With parameter tags, it is possible to categorize the parameters.
In this patch, all role-specific parameters of the services are
categorized as role_specific, which will help in adding validation
during the deployment (to ensure the provided role-specific
parameter is actually implemented as role-specific). This patch
adds only the tags, and the validation will done via workflows.

Change-Id: Ic053111298e7872a3a3cd11e6249dbd85707cc29
---
 .../pre_network/host_config_and_reboot.yaml   | 31 +++++++++++++++++++
 puppet/services/neutron-ovs-dpdk-agent.yaml   |  4 +++
 puppet/services/neutron-sriov-agent.yaml      |  8 +++++
 .../services/neutron-sriov-host-config.yaml   |  2 ++
 puppet/services/nova-compute.yaml             |  4 +++
 puppet/services/opendaylight-ovs.yaml         | 10 ++++++
 puppet/services/openvswitch.yaml              | 10 ++++++
 puppet/services/tuned.yaml                    |  2 ++
 8 files changed, 71 insertions(+)

diff --git a/extraconfig/pre_network/host_config_and_reboot.yaml b/extraconfig/pre_network/host_config_and_reboot.yaml
index 3b311f283e..7ded5a337b 100644
--- a/extraconfig/pre_network/host_config_and_reboot.yaml
+++ b/extraconfig/pre_network/host_config_and_reboot.yaml
@@ -18,6 +18,8 @@ parameters:
     default: false
     description: Whether or not to configure enable DPDK in OVS
     type: boolean
+    tags:
+      - role_specific
   OvsDpdkCoreList:
     description: >
       List of cores to be used for DPDK lcore threads.  Note, these threads
@@ -26,12 +28,16 @@ parameters:
     constraints:
       - allowed_pattern: "[0-9,-]*"
     default: ""
+    tags:
+      - role_specific
   OvsDpdkMemoryChannels:
     description: Number of memory channels per socket to be used for DPDK
     type: string
     constraints:
       - allowed_pattern: "[0-9]*"
     default: ""
+    tags:
+      - role_specific
   OvsDpdkSocketMemory:
     default: ""
     description: >
@@ -41,6 +47,8 @@ parameters:
       mem>, <socket n mem>", where the value is specified in MB.  For example:
       "1024,0".
     type: string
+    tags:
+      - role_specific
   OvsPmdCoreList:
     description: >
       A list or range of CPU cores for PMD threads to be pinned to.  Note, NIC
@@ -55,6 +63,8 @@ parameters:
       - allowed_pattern: "[0-9,-]*"
     type: string
     default: ""
+    tags:
+      - role_specific
   deployment_actions:
     default: ['CREATE', 'UPDATE']
     type: comma_delimited_list
@@ -70,6 +80,27 @@ parameters:
       config during an upgrade. By default DPDK will be enabled during the
       CREATE action only. But on cases when it requires for certain migration,
       it may be required to run it for UPDATE action too.
+  KernelArgs:
+    default: ""
+    type: string
+    description: Kernel Args to apply to the host
+    tags:
+      - role_specific
+  TunedProfileName:
+    default: ""
+    type: string
+    description: Tuned Profile to apply to the host
+    tags:
+      - role_specific
+  IsolCpusList:
+    default: ""
+    type: string
+    description: >
+      List of logical CPU ids whic need to be isolated from the host processes.
+      This input is provided to the tuned profile cpu-partitioning to configure
+      systemd and repin interrupts (IRQ repinning).
+    tags:
+      - role_specific
   # DEPRECATED: the following options are deprecated and are currently maintained
   # for backwards compatibility. They will be removed in the Queens cycle.
   HostCpusList:
diff --git a/puppet/services/neutron-ovs-dpdk-agent.yaml b/puppet/services/neutron-ovs-dpdk-agent.yaml
index 71c4474e3f..180da486d2 100644
--- a/puppet/services/neutron-ovs-dpdk-agent.yaml
+++ b/puppet/services/neutron-ovs-dpdk-agent.yaml
@@ -37,10 +37,14 @@ parameters:
     default: ""
     description: Datapath type for ovs bridges
     type: string
+    tags:
+      - role_specific
   NeutronVhostuserSocketDir:
     default: ""
     description: The vhost-user socket directory for OVS
     type: string
+    tags:
+      - role_specific
 
 resources:
 
diff --git a/puppet/services/neutron-sriov-agent.yaml b/puppet/services/neutron-sriov-agent.yaml
index 9c61032aa9..03b6766e3d 100644
--- a/puppet/services/neutron-sriov-agent.yaml
+++ b/puppet/services/neutron-sriov-agent.yaml
@@ -40,6 +40,8 @@ parameters:
       Example "tenant0:ens2f0,tenant1:ens2f1"
     type: comma_delimited_list
     default: ""
+    tags:
+      - role_specific
   NeutronExcludeDevices:
     description: >
       List of <network_device>:<excluded_devices> mapping
@@ -50,6 +52,8 @@ parameters:
       physical_device_mappings list.
     type: comma_delimited_list
     default: ""
+    tags:
+      - role_specific
   NeutronSriovNumVFs:
     description: >
       Provide the list of VFs to be reserved for each SR-IOV interface.
@@ -57,11 +61,15 @@ parameters:
       Example "eth1:4096,eth2:128"
     type: comma_delimited_list
     default: ""
+    tags:
+      - role_specific
   NeutronSriovAgentExtensions:
     default: ""
     description: >
         Comma-separated list of extensions enabled for the Neutron SR-IOV agents.
     type: comma_delimited_list
+    tags:
+      - role_specific
 
 resources:
 
diff --git a/puppet/services/neutron-sriov-host-config.yaml b/puppet/services/neutron-sriov-host-config.yaml
index 254bd4bd58..511a90333e 100644
--- a/puppet/services/neutron-sriov-host-config.yaml
+++ b/puppet/services/neutron-sriov-host-config.yaml
@@ -38,6 +38,8 @@ parameters:
       Example "eth1:4096,eth2:128"
     type: comma_delimited_list
     default: ""
+    tags:
+      - role_specific
 
 resources:
 
diff --git a/puppet/services/nova-compute.yaml b/puppet/services/nova-compute.yaml
index c692a911fd..bd2360294b 100644
--- a/puppet/services/nova-compute.yaml
+++ b/puppet/services/nova-compute.yaml
@@ -79,6 +79,8 @@ parameters:
       Ex. NovaVcpuPinSet: ['4-12','^8'] will reserve cores from 4-12 excluding 8
     type: comma_delimited_list
     default: []
+    tags:
+      - role_specific
   NovaReservedHostMemory:
     description: >
       Reserved RAM for host processes.
@@ -86,6 +88,8 @@ parameters:
     default: 4096
     constraints:
       - range: { min: 512 }
+    tags:
+      - role_specific
   MonitoringSubscriptionNovaCompute:
     default: 'overcloud-nova-compute'
     type: string
diff --git a/puppet/services/opendaylight-ovs.yaml b/puppet/services/opendaylight-ovs.yaml
index 7f98df8bff..f6ca4b0200 100644
--- a/puppet/services/opendaylight-ovs.yaml
+++ b/puppet/services/opendaylight-ovs.yaml
@@ -33,16 +33,22 @@ parameters:
                  Required for VLAN deployments.  For example physnet1 -> eth1.
     type: comma_delimited_list
     default: "datacentre:br-ex"
+    tags:
+      - role_specific
   HostAllowedNetworkTypes:
     description: Allowed tenant network types for this OVS host.  Note this can
                  vary per host or role to constrain which hosts nova instances
                  and networks are scheduled to.
     type: comma_delimited_list
     default: ['local', 'vlan', 'vxlan', 'gre']
+    tags:
+      - role_specific
   OvsEnableDpdk:
     description: Whether or not to configure enable DPDK in OVS
     default:  false
     type: boolean
+    tags:
+      - role_specific
   OvsVhostuserMode:
     description: Specify the mode for OVS with vhostuser port creation.  In
                  client mode, the hypervisor will be responsible for creating
@@ -51,10 +57,14 @@ parameters:
     default: "client"
     constraints:
       - allowed_values: [ 'client', 'server' ]
+    tags:
+      - role_specific
   VhostuserSocketDir:
     description: Specify the directory to use for vhostuser sockets
     type: string
     default: "/var/run/openvswitch"
+    tags:
+      - role_specific
   EndpointMap:
     default: {}
     description: Mapping of service endpoint -> protocol. Typically set
diff --git a/puppet/services/openvswitch.yaml b/puppet/services/openvswitch.yaml
index 8c375c6e26..5d55da2953 100644
--- a/puppet/services/openvswitch.yaml
+++ b/puppet/services/openvswitch.yaml
@@ -38,12 +38,16 @@ parameters:
     constraints:
       - allowed_pattern: "[0-9,-]*"
     default: ""
+    tags:
+      - role_specific
   OvsDpdkMemoryChannels:
     description: Number of memory channels per socket to be used for DPDK
     type: string
     constraints:
       - allowed_pattern: "[0-9]*"
     default: ""
+    tags:
+      - role_specific
   OvsDpdkSocketMemory:
     default: ""
     description: >
@@ -53,12 +57,16 @@ parameters:
       mem>, <socket n mem>", where the value is specified in MB.  For example:
       "1024,0".
     type: string
+    tags:
+      - role_specific
   OvsDpdkDriverType:
     default: "vfio-pci"
     description: >
       DPDK Driver type. Ensure the Overcloud NIC to be used for DPDK supports
       this UIO/PMD driver.
     type: string
+    tags:
+      - role_specific
   OvsPmdCoreList:
     description: >
       A list or range of CPU cores for PMD threads to be pinned to.  Note, NIC
@@ -73,6 +81,8 @@ parameters:
       - allowed_pattern: "[0-9,-]*"
     type: string
     default: ""
+    tags:
+      - role_specific
   # DEPRECATED: the following options are deprecated and are currently maintained
   # for backwards compatibility. They will be removed in the Queens cycle.
   HostCpusList:
diff --git a/puppet/services/tuned.yaml b/puppet/services/tuned.yaml
index 2d1b49d28b..5193bf5c1d 100644
--- a/puppet/services/tuned.yaml
+++ b/puppet/services/tuned.yaml
@@ -34,6 +34,8 @@ parameters:
     default: ''
     description: Tuned Profile to apply to the host
     type: string
+    tags:
+      - role_specific
 
 outputs:
   role_data: