Merge "Don't create networks if neutron is not enabled"
[apex-tripleo-heat-templates.git] / puppet / services / swift-proxy.yaml
index 0c3cc1e..9a304ed 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
@@ -53,6 +61,10 @@ parameters:
     description: Set to False to disable the swift proxy ceilometer pipeline.
     default: True
     type: boolean
+  SwiftCeilometerIgnoreProjects:
+    default: ['services']
+    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]}
+  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,7 +111,7 @@ 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}
@@ -94,6 +120,10 @@ outputs:
             swift::proxy::workers: {get_param: SwiftWorkers}
             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::staticweb::url_base: {get_param: [EndpointMap, SwiftPublic, uri_no_suffix]}
             swift::proxy::ceilometer::nonblocking_notify: true
             tripleo::profile::base::swift::proxy::rabbit_port: {get_param: RabbitClientPort}
@@ -146,7 +176,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 +214,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]