1 heat_template_version: pike
4 Containerized Sensu client service
9 default: 'tripleoupstream'
11 DockerSensuClientImage:
13 default: 'centos-binary-sensu-client:latest'
15 DockerSensuConfigImage:
16 description: The container image to use for the sensu config_volume
17 default: 'centos-binary-sensu-client:latest'
21 description: Mapping of service endpoint -> protocol. Typically set
22 via parameter_defaults in the resource registry.
26 description: Mapping of service_name -> network name. Typically set
27 via parameter_defaults in the resource registry. This
28 mapping overrides those in ServiceNetMapDefaults.
35 description: Role name on which the service is applied
39 description: Parameters specific to the role
41 SensuDockerCheckCommand:
44 for i in $(docker ps --format '{{.ID}}'); do
45 if result=$(docker inspect --format='{{.State.Health.Status}}' $i 2>/dev/null); then
46 if [ "$result" != 'healthy' ]; then
47 echo "$(docker inspect --format='{{.Name}}' $i) ($i): $(docker inspect --format='{{json .State}}' $i)" && exit 2;
51 SensuDockerCheckInterval:
53 description: The frequency in seconds the docker health check is executed.
55 SensuDockerCheckHandlers:
57 description: The Sensu event handler to use for events
58 created by the docker health check.
59 type: comma_delimited_list
60 SensuDockerCheckOccurrences:
62 description: The number of event occurrences before sensu-plugin-aware handler should take action.
64 SensuDockerCheckRefresh:
66 description: The number of seconds sensu-plugin-aware handlers should wait before taking second action.
72 type: ./containers-common.yaml
75 type: ../../puppet/services/monitoring/sensu-client.yaml
77 EndpointMap: {get_param: EndpointMap}
78 ServiceNetMap: {get_param: ServiceNetMap}
79 DefaultPasswords: {get_param: DefaultPasswords}
83 description: Role data for the Sensu client role.
85 service_name: {get_attr: [SensuClientBase, role_data, service_name]}
88 - get_attr: [SensuClientBase, role_data, config_settings]
92 command: {get_param: SensuDockerCheckCommand}
93 interval: {get_param: SensuDockerCheckInterval}
94 handlers: {get_param: SensuDockerCheckHandlers}
95 occurrences: {get_param: SensuDockerCheckOccurrences}
96 refresh: {get_param: SensuDockerCheckRefresh}
97 step_config: &step_config
98 get_attr: [SensuClientBase, role_data, step_config]
99 service_config_settings: {get_attr: [SensuClientBase, role_data, service_config_settings]}
100 # BEGIN DOCKER SETTINGS
103 puppet_tags: sensu_rabbitmq_config,sensu_client_config,sensu_check_config,sensu_check
104 step_config: *step_config
108 - [ {get_param: DockerNamespace}, {get_param: DockerSensuConfigImage} ]
110 /var/lib/kolla/config_files/sensu-client.json:
111 command: /usr/bin/sensu-client -d /etc/sensu/conf.d/ -l /var/log/sensu/sensu-client.log
113 - path: /var/log/sensu
122 - [ {get_param: DockerNamespace}, {get_param: DockerSensuClientImage} ]
125 # NOTE(mmagr) kolla image changes the user to 'sensu', we need it
126 # to be root have rw permission to docker.sock to run successfully
127 # "docker inspect" command
132 - {get_attr: [ContainersCommon, volumes]}
134 - /var/run/docker.sock:/var/run/docker.sock:rw
135 - /var/lib/kolla/config_files/sensu-client.json:/var/lib/kolla/config_files/config.json:ro
136 - /var/lib/config-data/sensu/etc/sensu/:/etc/sensu/:ro
137 - /var/log/containers/sensu:/var/log/sensu:rw
139 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
141 - name: create persistent logs directory
143 path: /var/log/containers/sensu
146 - name: Stop and disable sensu-client service
148 service: name=sensu-client.service state=stopped enabled=no