Merge "Add services to ServiceNetMap to select hostnames resolution network"
[apex-tripleo-heat-templates.git] / puppet / controller-puppet.yaml
index c5adeb9..9f531ef 100644 (file)
@@ -72,6 +72,10 @@ parameters:
     default: ''
     description: Set to True to enable debugging on all services.
     type: string
+  EnableFencing:
+    default: false
+    description: Whether to enable fencing in Pacemaker or not.
+    type: boolean
   EnableGalera:
     default: true
     description: Whether to use Galera instead of regular MariaDB.
@@ -122,6 +126,38 @@ parameters:
           }
         }
     type: json
+  FencingConfig:
+    default: {}
+    description: |
+      Pacemaker fencing configuration. The JSON should have
+      the following structure:
+        {
+          "devices": [
+            {
+              "agent": "AGENT_NAME",
+              "host_mac": "HOST_MAC_ADDRESS",
+              "params": {"PARAM_NAME": "PARAM_VALUE"}
+            }
+          ]
+        }
+      For instance:
+        {
+          "devices": [
+            {
+              "agent": "fence_xvm",
+              "host_mac": "52:54:00:aa:bb:cc",
+              "params": {
+                "multicast_address": "225.0.0.12",
+                "port": "baremetal_0",
+                "manage_fw": true,
+                "manage_key_file": true,
+                "key_file": "/etc/fence_xvm.key",
+                "key_file_password": "abcdef"
+              }
+            }
+          ]
+        }
+    type: json
   Flavor:
     description: Flavor for control nodes to request when deploying.
     type: string
@@ -252,6 +288,10 @@ parameters:
     default: 'False'
     description: Whether to enable l3-agent HA
     type: string
+  NeutronDhcpAgentsPerNetwork:
+    type: number
+    default: 3
+    description: The number of neutron dhcp agents to schedule per network
   NeutronDVR:
     default: 'False'
     description: Whether to configure Neutron Distributed Virtual Routers
@@ -638,6 +678,7 @@ resources:
             - - 'http://'
               - {get_param: KeystonePublicApiVirtualIP}
               - ':5000/v2.0/'
+        enable_fencing: {get_param: EnableFencing}
         enable_galera: {get_param: EnableGalera}
         enable_ceph_storage: {get_param: EnableCephStorage}
         enable_swift_storage: {get_param: EnableSwiftStorage}
@@ -655,6 +696,7 @@ resources:
         neutron_mechanism_drivers: {get_param: NeutronMechanismDrivers}
         neutron_allow_l3agent_failover: {get_param: NeutronAllowL3AgentFailover}
         neutron_l3_ha: {get_param: NeutronL3HA}
+        neutron_dhcp_agents_per_network: {get_param: NeutronDhcpAgentsPerNetwork}
         neutron_network_vlan_ranges:
           str_replace:
             template: "['RANGES']"
@@ -719,6 +761,7 @@ resources:
               - '@'
               - {get_param: MysqlVirtualIP}
               - '/nova'
+        fencing_config: {get_param: FencingConfig}
         pcsd_password: {get_param: PcsdPassword}
         rabbit_username: {get_param: RabbitUserName}
         rabbit_password: {get_param: RabbitPassword}
@@ -791,6 +834,7 @@ resources:
             - vip_data # provided by vip-config
             - '"%{::osfamily}"'
             - common
+            - cinder_netapp_data # Optionally provided by ControllerExtraConfigPre
           datafiles:
             common:
               raw_data: {get_file: hieradata/common.yaml}
@@ -808,7 +852,9 @@ resources:
                 bootstack_nodeid: {get_input: bootstack_nodeid}
 
                 # Pacemaker
+                enable_fencing: {get_input: enable_fencing}
                 hacluster_pwd: {get_input: pcsd_password}
+                tripleo::fencing::config: {get_input: fencing_config}
 
                 # Swift
                 swift::proxy::proxy_local_net_ip: {get_input: swift_proxy_network}
@@ -932,6 +978,7 @@ resources:
                 neutron_mechanism_drivers: {get_input: neutron_mechanism_drivers}
                 neutron::server::allow_automatic_l3agent_failover: {get_input: neutron_allow_l3agent_failover}
                 neutron::server::l3_ha: {get_input: neutron_l3_ha}
+                neutron::dhcp_agents_per_network: {get_input: neutron_dhcp_agents_per_network}
                 neutron::plugins::ml2::network_vlan_ranges: {get_input: neutron_network_vlan_ranges}
                 neutron_bridge_mappings: {get_input: neutron_bridge_mappings}
                 neutron_public_interface: {get_input: neutron_public_interface}
@@ -1007,6 +1054,13 @@ resources:
                 tripleo::loadbalancer::public_virtual_interface: {get_input: public_virtual_interface}
                 enable_package_install: {get_input: enable_package_install}
 
+  # Hook for site-specific additional pre-deployment config, e.g extra hieradata
+  ControllerExtraConfigPre:
+    depends_on: ControllerDeployment
+    type: OS::TripleO::ControllerExtraConfigPre
+    properties:
+        server: {get_resource: Controller}
+
   UpdateConfig:
     type: OS::TripleO::Tasks::PackageUpdate
 
@@ -1055,7 +1109,7 @@ outputs:
       str_replace:
         template: IP HOST.localdomain HOST CLOUDNAME
         params:
-          IP: {get_attr: [Controller, networks, ctlplane, 0]}
+          IP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, ControllerHostnameResolveNetwork]}]}
           HOST: {get_attr: [Controller, name]}
           CLOUDNAME: {get_param: CloudName}
   nova_server_resource:
@@ -1078,4 +1132,8 @@ outputs:
           IP: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, MemcachedNetwork]}]}
   config_identifier:
     description: identifier which changes if the controller configuration may need re-applying
-    value: {get_attr: [ControllerDeployment, deploy_stdout]}
+    value:
+      list_join:
+      - ','
+      - - {get_attr: [ControllerDeployment, deploy_stdout]}
+        - {get_attr: [ControllerExtraConfigPre, deploy_stdout]}