pacemaker remote profile support
authorMichele Baldessari <michele@acksyn.org>
Tue, 22 Nov 2016 21:27:34 +0000 (22:27 +0100)
committerMichele Baldessari <michele@acksyn.org>
Tue, 24 Jan 2017 11:18:14 +0000 (12:18 +0100)
This adds a pacemaker_remote puppet service so that an operator
can automatically deploy pacemaker-remote on nodes of his choice.

Change-Id: I9678606b3de9b9f4c03014b33c1dd27fcba67513
Depends-On: I581552dfa64160e2f82f6a9b8f2ae521c3d6da8d
Depends-On: I92953afcc7d536d387381f08164cae8b52f41605

environments/puppet-pacemaker.yaml
network/service_net_map.j2.yaml
overcloud-resource-registry-puppet.j2.yaml
puppet/services/pacemaker.yaml
puppet/services/pacemaker_remote.yaml [new file with mode: 0644]

index 0b71dbd..da607a7 100644 (file)
@@ -12,6 +12,7 @@ resource_registry:
   OS::TripleO::Services::RabbitMQ: ../puppet/services/pacemaker/rabbitmq.yaml
   OS::TripleO::Services::HAproxy: ../puppet/services/pacemaker/haproxy.yaml
   OS::TripleO::Services::Pacemaker: ../puppet/services/pacemaker.yaml
+  OS::TripleO::Services::PacemakerRemote: ../puppet/services/pacemaker_remote.yaml
   OS::TripleO::Services::Redis: ../puppet/services/pacemaker/database/redis.yaml
   OS::TripleO::Services::MySQL: ../puppet/services/pacemaker/database/mysql.yaml
   # Services that are disabled by default (use relevant environment files):
index 36342cb..cb4f464 100644 (file)
@@ -64,6 +64,7 @@ parameters:
       OvnDbsNetwork: internal_api
       MistralApiNetwork: internal_api
       ZaqarApiNetwork: internal_api
+      PacemakerRemoteNetwork: internal_api
       # We special-case the default ResolveNetwork for the CephStorage role
       # for backwards compatibility, all other roles default to internal_api
       CephStorageHostnameResolveNetwork: storage
index 47dfebb..01f2239 100644 (file)
@@ -159,6 +159,7 @@ resource_registry:
   OS::TripleO::Services::NeutronOvsAgent: puppet/services/neutron-ovs-agent.yaml
   OS::TripleO::Services::ComputeNeutronOvsAgent: puppet/services/neutron-ovs-agent.yaml
   OS::TripleO::Services::Pacemaker: OS::Heat::None
+  OS::TripleO::Services::PacemakerRemote: OS::Heat::None
   OS::TripleO::Services::NeutronSriovAgent: OS::Heat::None
   OS::TripleO::Services::RabbitMQ: puppet/services/rabbitmq.yaml
   OS::TripleO::Services::HAproxy: puppet/services/haproxy.yaml
index 9adf1bd..a8a9fb9 100644 (file)
@@ -29,6 +29,11 @@ parameters:
     default: false
     description: Whether to enable fencing in Pacemaker or not.
     type: boolean
+  PacemakerRemoteAuthkey:
+    type: string
+    description: The authkey for the pacemaker remote service.
+    hidden: true
+    default: ''
   PcsdPassword:
     type: string
     description: The password for the 'pcsd' user for pacemaker.
@@ -112,5 +117,6 @@ outputs:
               passwords:
                 - {get_param: PcsdPassword}
                 - {get_param: [DefaultPasswords, pcsd_password]}
+        tripleo::profile::base::pacemaker::remote_authkey: {get_param: PacemakerRemoteAuthkey}
       step_config: |
         include ::tripleo::profile::base::pacemaker
diff --git a/puppet/services/pacemaker_remote.yaml b/puppet/services/pacemaker_remote.yaml
new file mode 100644 (file)
index 0000000..daee43e
--- /dev/null
@@ -0,0 +1,57 @@
+heat_template_version: ocata
+
+description: >
+  Pacemaker remote service configured with Puppet
+
+parameters:
+  ServiceNetMap:
+    default: {}
+    description: Mapping of service_name -> network name. Typically set
+                 via parameter_defaults in the resource registry.  This
+                 mapping overrides those in ServiceNetMapDefaults.
+    type: json
+  DefaultPasswords:
+    default: {}
+    type: json
+  EndpointMap:
+    default: {}
+    description: Mapping of service endpoint -> protocol. Typically set
+                 via parameter_defaults in the resource registry.
+    type: json
+  PacemakerRemoteAuthkey:
+    type: string
+    description: The authkey for the pacemaker remote service.
+    hidden: true
+    default: ''
+  MonitoringSubscriptionPacemakerRemote:
+    default: 'overcloud-pacemaker_remote'
+    type: string
+  PacemakerRemoteLoggingSource:
+    type: json
+    default:
+      tag: system.pacemaker_remote
+      path: /var/log/pacemaker.log
+      format: >-
+        /^(?<time>[^ ]*\s*[^ ]* [^ ]*)
+        \[(?<pid>[^ ]*)\]
+        (?<host>[^ ]*)
+        (?<message>.*)$/
+
+outputs:
+  role_data:
+    description: Role data for the Pacemaker remote role.
+    value:
+      service_name: pacemaker_remote
+      monitoring_subscription: {get_param: MonitoringSubscriptionPacemakerRemote}
+      logging_groups:
+        - haclient
+      logging_source: {get_param: PacemakerRemoteLoggingSource}
+      config_settings:
+        tripleo.pacemaker_remote.firewall_rules:
+          '130 pacemaker_remote tcp':
+            proto: 'tcp'
+            dport:
+              - 3121
+        tripleo::profile::base::pacemaker_remote::remote_authkey: {get_param: PacemakerRemoteAuthkey}
+      step_config: |
+        include ::tripleo::profile::base::pacemaker_remote