Composable Timezone service - Controller
authorCarlos Camacho <ccamacho@redhat.com>
Mon, 20 Jun 2016 06:37:55 +0000 (08:37 +0200)
committerEmilien Macchi <emilien@redhat.com>
Thu, 30 Jun 2016 22:53:51 +0000 (22:53 +0000)
Add timezone as a composable service

Change-Id: I99f0b0727a10ee74ea1de0499c8bc3ba37ab3345
Partially-implements: blueprint composable-services-within-roles

overcloud-resource-registry-puppet.yaml
overcloud.yaml
puppet/controller.yaml
puppet/manifests/overcloud_controller.pp
puppet/manifests/overcloud_controller_pacemaker.pp
puppet/services/time/timezone.yaml [new file with mode: 0644]

index 0bfb9c2..8091a9a 100644 (file)
@@ -164,6 +164,7 @@ resource_registry:
   OS::TripleO::Services::SwiftProxy: puppet/services/swift-proxy.yaml
   OS::TripleO::Services::SwiftStorage: puppet/services/swift-storage.yaml
   OS::TripleO::Services::Snmp: puppet/services/snmp.yaml
+  OS::TripleO::Services::Timezone: puppet/services/time/timezone.yaml
 
 parameter_defaults:
   EnablePackageInstall: false
index bc29dae..62dfb94 100644 (file)
@@ -266,6 +266,7 @@ parameters:
         Control the IP allocation for the StorageMgmgVirtualInterface port. E.g.
         [{'ip_address':'1.2.3.4'}]
     type: json
+  #TODO(ccamacho):Remove after landing composable timezone for all nodes
   TimeZone:
     default: 'UTC'
     description: The timezone to be set on nodes.
@@ -567,6 +568,7 @@ parameters:
       - OS::TripleO::Services::SwiftProxy
       - OS::TripleO::Services::SwiftStorage
       - OS::TripleO::Services::Snmp
+      - OS::TripleO::Services::Timezone
     description: A list of service resources (configured in the Heat
                  resource_registry) which represent nested stacks
                  for each service that should get installed on the Controllers.
@@ -866,7 +868,6 @@ resources:
           SwiftMinPartHours: {get_param: SwiftMinPartHours}
           SwiftPartPower: {get_param: SwiftPartPower}
           SwiftReplicas: { get_param: SwiftReplicas}
-          TimeZone: {get_param: TimeZone}
           ServiceNetMap: {get_param: ServiceNetMap}
           EndpointMap: {get_attr: [EndpointMap, endpoint_map]}
           MysqlVirtualIP: {get_attr: [VipMap, net_ip_map, {get_param: [ServiceNetMap, MysqlNetwork]}]}
index 865b5c7..e9833b4 100644 (file)
@@ -326,10 +326,6 @@ parameters:
     type: number
     default: 3
     description: How many replicas to use in the swift rings.
-  TimeZone:
-    default: 'UTC'
-    description: The timezone to be set on controller nodes.
-    type: string
   UpgradeLevelNovaCompute:
     type: string
     description: Nova Compute upgrade level
@@ -688,7 +684,6 @@ resources:
         rabbit_cookie: {get_param: RabbitCookie}
         rabbit_client_use_ssl: {get_param: RabbitClientUseSSL}
         rabbit_client_port: {get_param: RabbitClientPort}
-        timezone: {get_param: TimeZone}
         control_virtual_interface: {get_param: ControlVirtualInterface}
         public_virtual_interface: {get_param: PublicVirtualInterface}
         swift_hash_suffix: {get_param: SwiftHashSuffix}
@@ -1001,7 +996,6 @@ resources:
                 # Misc
                 memcached_ipv6: {get_input: memcached_ipv6}
                 memcached::listen_ip: {get_input: memcached_network}
-                timezone::timezone: {get_input: timezone}
                 control_virtual_interface: {get_input: control_virtual_interface}
                 public_virtual_interface: {get_input: public_virtual_interface}
                 tripleo::keepalived::control_virtual_interface: {get_input: control_virtual_interface}
index b79eca4..d8166f2 100644 (file)
@@ -28,8 +28,6 @@ if hiera('step') >= 1 {
 
 if hiera('step') >= 2 {
 
-  include ::timezone
-
   # MongoDB
   if downcase(hiera('ceilometer_backend')) == 'mongodb' {
     # NOTE(gfidente): We need to pass the list of IPv6 addresses *with* port and
index e095c96..9f636dd 100644 (file)
@@ -57,8 +57,6 @@ if hiera('step') >= 1 {
   create_resources(sysctl::value, hiera('sysctl_settings'), {})
   Exec <| tag == 'kmod::load' |>  -> Sysctl <| |>
 
-  include ::timezone
-
   $pacemaker_cluster_members = downcase(regsubst(hiera('controller_node_names'), ',', ' ', 'G'))
   $corosync_ipv6 = str2bool(hiera('corosync_ipv6', false))
   if $corosync_ipv6 {
diff --git a/puppet/services/time/timezone.yaml b/puppet/services/time/timezone.yaml
new file mode 100644 (file)
index 0000000..13fda98
--- /dev/null
@@ -0,0 +1,24 @@
+heat_template_version: 2016-04-08
+
+description: >
+  Composable Timezone service
+
+parameters:
+  EndpointMap:
+    default: {}
+    description: Mapping of service endpoint -> protocol. Typically set
+                 via parameter_defaults in the resource registry.
+    type: json
+  TimeZone:
+    default: 'UTC'
+    description: The timezone to be set on the overcloud.
+    type: string
+
+outputs:
+  role_data:
+    description: Timezone role using composable services.
+    value:
+      config_settings:
+        timezone::timezone: {get_param: TimeZone}
+      step_config: |
+        include ::timezone