Render isolated network templates using jinja2
[apex-tripleo-heat-templates.git] / docker / services / sensu-client.yaml
index e6bdf15..b64231c 100644 (file)
@@ -4,19 +4,21 @@ description: >
   Containerized Sensu client service
 
 parameters:
-  DockerNamespace:
-    description: namespace
-    default: 'tripleoupstream'
-    type: string
   DockerSensuClientImage:
     description: image
-    default: 'centos-binary-sensu-client:latest'
+    type: string
+  DockerSensuConfigImage:
+    description: The container image to use for the sensu config_volume
     type: string
   EndpointMap:
     default: {}
     description: Mapping of service endpoint -> protocol. Typically set
                  via parameter_defaults in the resource registry.
     type: json
+  ServiceData:
+    default: {}
+    description: Dictionary packing service data
+    type: json
   ServiceNetMap:
     default: {}
     description: Mapping of service_name -> network name. Typically set
@@ -71,6 +73,7 @@ resources:
     type: ../../puppet/services/monitoring/sensu-client.yaml
     properties:
       EndpointMap: {get_param: EndpointMap}
+      ServiceData: {get_param: ServiceData}
       ServiceNetMap: {get_param: ServiceNetMap}
       DefaultPasswords: {get_param: DefaultPasswords}
 
@@ -98,17 +101,23 @@ outputs:
         config_volume: sensu
         puppet_tags:  sensu_rabbitmq_config,sensu_client_config,sensu_check_config,sensu_check
         step_config: *step_config
-        config_image: &sensu_client_image
-          list_join:
-            - '/'
-            - [ {get_param: DockerNamespace}, {get_param: DockerSensuClientImage} ]
+        config_image: {get_param: DockerSensuConfigImage}
       kolla_config:
         /var/lib/kolla/config_files/sensu-client.json:
-          command: /usr/bin/sensu-client -d /etc/sensu/conf.d/
+          command: /usr/bin/sensu-client -d /etc/sensu/conf.d/ -l /var/log/sensu/sensu-client.log
+          config_files:
+            - source: "/var/lib/kolla/config_files/src/*"
+              dest: "/"
+              merge: true
+              preserve_properties: true
+          permissions:
+            - path: /var/log/sensu
+              owner: sensu:sensu
+              recurse: true
       docker_config:
         step_3:
           sensu_client:
-            image: *sensu_client_image
+            image: {get_param: DockerSensuClientImage}
             net: host
             privileged: true
             # NOTE(mmagr) kolla image changes the user to 'sensu', we need it
@@ -122,9 +131,15 @@ outputs:
                 -
                   - /var/run/docker.sock:/var/run/docker.sock:rw
                   - /var/lib/kolla/config_files/sensu-client.json:/var/lib/kolla/config_files/config.json:ro
-                  - /var/lib/config-data/sensu/etc/sensu/:/etc/sensu/:ro
+                  - /var/lib/config-data/puppet-generated/sensu/:/var/lib/kolla/config_files/src:ro
+                  - /var/log/containers/sensu:/var/log/sensu:rw
             environment:
               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
+      host_prep_tasks:
+        - name: create persistent logs directory
+          file:
+            path: /var/log/containers/sensu
+            state: directory
       upgrade_tasks:
         - name: Stop and disable sensu-client service
           tags: step2