Merge "Fix typo in config_volume"
[apex-tripleo-heat-templates.git] / puppet / services / swift-proxy.yaml
index 0c3cc1e..c707efb 100644 (file)
@@ -1,4 +1,4 @@
-heat_template_version: ocata
+heat_template_version: pike
 
 description: >
   OpenStack Swift Proxy service configured with Puppet
@@ -13,6 +13,14 @@ parameters:
   DefaultPasswords:
     default: {}
     type: json
+  RoleName:
+    default: ''
+    description: Role name on which the service is applied
+    type: string
+  RoleParameters:
+    default: {}
+    description: Parameters specific to the role
+    type: json
   EndpointMap:
     default: {}
     description: Mapping of service endpoint -> protocol. Typically set
@@ -51,8 +59,12 @@ parameters:
     type: string
   SwiftCeilometerPipelineEnabled:
     description: Set to False to disable the swift proxy ceilometer pipeline.
-    default: True
+    default: false
     type: boolean
+  SwiftCeilometerIgnoreProjects:
+    default: ['service']
+    description: Comma-seperated list of project names to ignore.
+    type: comma_delimited_list
   RabbitClientPort:
     default: 5672
     description: Set rabbit subscriber port, change this if using SSL
@@ -63,10 +75,14 @@ parameters:
         Rabbit client subscriber parameter to specify
         an SSL connection to the RabbitMQ host.
     type: string
+  EnableInternalTLS:
+    type: boolean
+    default: false
 
 conditions:
 
-  ceilometer_pipeline_enabled: {equals : [{get_param: SwiftCeilometerPipelineEnabled}, True]}
+  ceilometer_pipeline_enabled: {equals : [{get_param: SwiftCeilometerPipelineEnabled}, true]}
+  use_tls_proxy: {equals : [{get_param: EnableInternalTLS}, true]}
 
 resources:
   SwiftBase:
@@ -75,6 +91,16 @@ resources:
       ServiceNetMap: {get_param: ServiceNetMap}
       DefaultPasswords: {get_param: DefaultPasswords}
       EndpointMap: {get_param: EndpointMap}
+      RoleName: {get_param: RoleName}
+      RoleParameters: {get_param: RoleParameters}
+
+  TLSProxyBase:
+    type: OS::TripleO::Services::TLSProxyBase
+    properties:
+      ServiceNetMap: {get_param: ServiceNetMap}
+      DefaultPasswords: {get_param: DefaultPasswords}
+      EndpointMap: {get_param: EndpointMap}
+      EnableInternalTLS: {get_param: EnableInternalTLS}
 
 outputs:
   role_data:
@@ -85,17 +111,27 @@ outputs:
       config_settings:
         map_merge:
           - get_attr: [SwiftBase, role_data, config_settings]
-
+          - get_attr: [TLSProxyBase, role_data, config_settings]
           - swift::proxy::authtoken::auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri]}
             swift::proxy::authtoken::auth_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
             swift::proxy::authtoken::password: {get_param: SwiftPassword}
             swift::proxy::authtoken::project_name: 'service'
             swift::proxy::node_timeout: {get_param: SwiftProxyNodeTimeout}
             swift::proxy::workers: {get_param: SwiftWorkers}
-            swift::proxy::ceilometer::rabbit_user: {get_param: RabbitUserName}
-            swift::proxy::ceilometer::rabbit_password: {get_param: RabbitPassword}
-            swift::proxy::staticweb::url_base: {get_param: [EndpointMap, SwiftPublic, uri_no_suffix]}
-            swift::proxy::ceilometer::nonblocking_notify: true
+          -
+            if:
+            - ceilometer_pipeline_enabled
+            -
+              swift::proxy::ceilometer::rabbit_user: {get_param: RabbitUserName}
+              swift::proxy::ceilometer::rabbit_password: {get_param: RabbitPassword}
+              swift::proxy::ceilometer::auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri]}
+              swift::proxy::ceilometer::auth_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
+              swift::proxy::ceilometer::password: {get_param: SwiftPassword}
+              swift::proxy::ceilometer::ignore_projects: {get_param: SwiftCeilometerIgnoreProjects}
+              swift::proxy::ceilometer::nonblocking_notify: true
+              swift::proxy::ceilometer::rabbit_use_ssl: {get_param: RabbitClientUseSSL}
+            - {}
+          - swift::proxy::staticweb::url_base: {get_param: [EndpointMap, SwiftPublic, uri_no_suffix]}
             tripleo::profile::base::swift::proxy::rabbit_port: {get_param: RabbitClientPort}
             tripleo::profile::base::swift::proxy::ceilometer_messaging_use_ssl: {get_param: RabbitClientUseSSL}
             tripleo::profile::base::swift::proxy::ceilometer_enabled: {get_param: SwiftCeilometerPipelineEnabled}
@@ -138,7 +174,6 @@ outputs:
                     - ''
                   - 'proxy-logging'
                   - 'proxy-server'
-            swift::proxy::ceilometer::rabbit_use_ssl: {get_param: RabbitClientUseSSL}
             swift::proxy::account_autocreate: true
             # NOTE: bind IP is found in Heat replacing the network name with the
             # local node IP for the given network; replacement examples
@@ -146,7 +181,22 @@ outputs:
             # internal_api -> IP
             # internal_api_uri -> [IP]
             # internal_api_subnet - > IP/CIDR
-            swift::proxy::proxy_local_net_ip: {get_param: [ServiceNetMap, SwiftProxyNetwork]}
+            tripleo::profile::base::swift::proxy::tls_proxy_bind_ip:
+              get_param: [ServiceNetMap, SwiftProxyNetwork]
+            tripleo::profile::base::swift::proxy::tls_proxy_fqdn:
+              str_replace:
+                template:
+                  "%{hiera('fqdn_$NETWORK')}"
+                params:
+                  $NETWORK: {get_param: [ServiceNetMap, SwiftProxyNetwork]}
+            tripleo::profile::base::swift::proxy::tls_proxy_port:
+              get_param: [EndpointMap, SwiftInternal, port]
+            swift::proxy::port: {get_param: [EndpointMap, SwiftInternal, port]}
+            swift::proxy::proxy_local_net_ip:
+              if:
+              - use_tls_proxy
+              - 'localhost'
+              - {get_param: [ServiceNetMap, SwiftProxyNetwork]}
       step_config: |
         include ::tripleo::profile::base::swift::proxy
       service_config_settings:
@@ -169,3 +219,5 @@ outputs:
         - name: Stop swift_proxy service
           tags: step1
           service: name=openstack-swift-proxy state=stopped
+      metadata_settings:
+        get_attr: [TLSProxyBase, role_data, metadata_settings]