1 heat_template_version: pike
4 Containerized Sensu client service
9 default: 'tripleoupstream'
11 DockerSensuClientImage:
13 default: 'centos-binary-sensu-client:latest'
17 description: Mapping of service endpoint -> protocol. Typically set
18 via parameter_defaults in the resource registry.
22 description: Mapping of service_name -> network name. Typically set
23 via parameter_defaults in the resource registry. This
24 mapping overrides those in ServiceNetMapDefaults.
31 description: Role name on which the service is applied
35 description: Parameters specific to the role
37 SensuDockerCheckCommand:
40 for i in $(docker ps --format '{{.ID}}'); do
41 if result=$(docker inspect --format='{{.State.Health.Status}}' $i 2>/dev/null); then
42 if [ "$result" != 'healthy' ]; then
43 echo "$(docker inspect --format='{{.Name}}' $i) ($i): $(docker inspect --format='{{json .State}}' $i)" && exit 2;
47 SensuDockerCheckInterval:
49 description: The frequency in seconds the docker health check is executed.
51 SensuDockerCheckHandlers:
53 description: The Sensu event handler to use for events
54 created by the docker health check.
55 type: comma_delimited_list
56 SensuDockerCheckOccurrences:
58 description: The number of event occurrences before sensu-plugin-aware handler should take action.
60 SensuDockerCheckRefresh:
62 description: The number of seconds sensu-plugin-aware handlers should wait before taking second action.
68 type: ./containers-common.yaml
71 type: ../../puppet/services/monitoring/sensu-client.yaml
73 EndpointMap: {get_param: EndpointMap}
74 ServiceNetMap: {get_param: ServiceNetMap}
75 DefaultPasswords: {get_param: DefaultPasswords}
79 description: Role data for the Sensu client role.
81 service_name: {get_attr: [SensuClientBase, role_data, service_name]}
84 - get_attr: [SensuClientBase, role_data, config_settings]
88 command: {get_param: SensuDockerCheckCommand}
89 interval: {get_param: SensuDockerCheckInterval}
90 handlers: {get_param: SensuDockerCheckHandlers}
91 occurrences: {get_param: SensuDockerCheckOccurrences}
92 refresh: {get_param: SensuDockerCheckRefresh}
93 step_config: &step_config
94 get_attr: [SensuClientBase, role_data, step_config]
95 service_config_settings: {get_attr: [SensuClientBase, role_data, service_config_settings]}
96 # BEGIN DOCKER SETTINGS
99 puppet_tags: sensu_rabbitmq_config,sensu_client_config,sensu_check_config,sensu_check
100 step_config: *step_config
101 config_image: &sensu_client_image
104 - [ {get_param: DockerNamespace}, {get_param: DockerSensuClientImage} ]
106 /var/lib/kolla/config_files/sensu-client.json:
107 command: /usr/bin/sensu-client -d /etc/sensu/conf.d/
111 image: *sensu_client_image
114 # NOTE(mmagr) kolla image changes the user to 'sensu', we need it
115 # to be root have rw permission to docker.sock to run successfully
116 # "docker inspect" command
121 - {get_attr: [ContainersCommon, volumes]}
123 - /var/run/docker.sock:/var/run/docker.sock:rw
124 - /var/lib/kolla/config_files/sensu-client.json:/var/lib/kolla/config_files/config.json:ro
125 - /var/lib/config-data/sensu/etc/sensu/:/etc/sensu/:ro
127 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
129 - name: Stop and disable sensu-client service
131 service: name=sensu-client.service state=stopped enabled=no