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