0e4932940972fe6be55dac33cd2823943291c5e4
[apex-tripleo-heat-templates.git] / docker / services / octavia-health-manager.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack Octavia health-manager service configured with Puppet
5
6 parameters:
7   DockerNamespace:
8     description: namespace
9     default: 'tripleoupstream'
10     type: string
11   DockerOctaviaHealthManagerImage:
12     description: image
13     default: 'centos-binary-octavia-health-manager:latest'
14     type: string
15   DockerOctaviaConfigImage:
16     description: The container image to use for the octavia config_volume
17     default: 'centos-binary-octavia-api:latest'
18     type: string
19   EndpointMap:
20     default: {}
21     description: Mapping of service endpoint -> protocol. Typically set
22                  via parameter_defaults in the resource registry.
23     type: json
24   ServiceNetMap:
25     default: {}
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.
29     type: json
30   DefaultPasswords:
31     default: {}
32     type: json
33   RoleName:
34     default: ''
35     description: Role name on which the service is applied
36     type: string
37   RoleParameters:
38     default: {}
39     description: Parameters specific to the role
40     type: json
41
42
43 resources:
44
45   ContainersCommon:
46     type: ./containers-common.yaml
47
48   OctaviaHealthManagerPuppetBase:
49     type: ../../puppet/services/octavia-health-manager.yaml
50     properties:
51       EndpointMap: {get_param: EndpointMap}
52       ServiceNetMap: {get_param: ServiceNetMap}
53       DefaultPasswords: {get_param: DefaultPasswords}
54       RoleName: {get_param: RoleName}
55       RoleParameters: {get_param: RoleParameters}
56
57 outputs:
58   role_data:
59     description: Role data for the Octavia health-manager role.
60     value:
61       service_name: {get_attr: [OctaviaHealthManagerPuppetBase, role_data, service_name]}
62       config_settings: {get_attr: [OctaviaHealthManagerPuppetBase, role_data, config_settings]}
63       step_config: &step_config
64         get_attr: [OctaviaHealthManagerPuppetBase, role_data, step_config]
65       service_config_settings: {get_attr: [OctaviaHealthManagerPuppetBase, role_data, service_config_settings]}
66       # BEGIN DOCKER SETTINGS #
67       puppet_config:
68         config_volume: octavia
69         puppet_tags: octavia_config
70         step_config: *step_config
71         config_image:
72           list_join:
73             - '/'
74             - [ {get_param: DockerNamespace}, {get_param: DockerOctaviaConfigImage} ]
75       kolla_config:
76         /var/lib/kolla/config_files/octavia_health_manager.json:
77           command: /usr/bin/octavia-health-manager --config-file /usr/share/octavia/octavia-dist.conf --config-file /etc/octavia/octavia.conf --log-file /var/log/octavia/health-manager.log --config-dir /etc/octavia/conf.d/common --config-dir /etc/octavia/conf.d/octavia-health-manager
78           config_files:
79             - source: "/var/lib/kolla/config_files/src/*"
80               dest: "/"
81               merge: true
82               preserve_properties: true
83       docker_config:
84         step_2:
85           octavia_health_manager_init_dirs:
86             start_order: 0
87             image: &octavia_health_manager_image
88               list_join:
89                 - '/'
90                 - [ {get_param: DockerNamespace}, {get_param: DockerOctaviaHealthManagerImage} ]
91             user: root
92             volumes:
93               # NOTE(mandre) we need extra dir for the service in /etc/octavia/conf.d
94               # It is normally created as part of the RPM install, but it is
95               # missing here because we use the same config_volume for all
96               # octavia services, hence the same container image to generate
97               # configuration.
98               - /var/lib/config-data/puppet-generated/octavia/etc/octavia:/etc/octavia/
99             command: ['/bin/bash', '-c', 'mkdir -p /etc/octavia/conf.d/octavia-health-manager; chown -R octavia:octavia /etc/octavia/conf.d/octavia-health-manager']
100         step_4:
101           octavia_health_manager:
102             start_order: 2
103             image: *octavia_health_manager_image
104             net: host
105             privileged: false
106             restart: always
107             volumes:
108               list_concat:
109                 - {get_attr: [ContainersCommon, volumes]}
110                 -
111                   - /var/lib/kolla/config_files/octavia_health_manager.json:/var/lib/kolla/config_files/config.json:ro
112                   - /var/lib/config-data/puppet-generated/octavia/:/var/lib/kolla/config_files/src:ro
113                   - /var/log/containers/octavia:/var/log/octavia
114             environment:
115               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
116       host_prep_tasks:
117         - name: create persistent logs directory
118           file:
119             path: /var/log/containers/octavia
120             state: directory
121       upgrade_tasks:
122         - name: Stop and disable octavia_health_manager service
123           tags: step2
124           service: name=openstack-octavia-health-manager state=stopped enabled=no