Merge "Replace outdated instruction with link to upstream doc"
[apex-tripleo-heat-templates.git] / docker / services / octavia-housekeeping.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack Octavia service configured with Puppet
5
6 parameters:
7   DockerOctaviaHousekeepingImage:
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
40
41 resources:
42
43   ContainersCommon:
44     type: ./containers-common.yaml
45
46   OctaviaHousekeepingPuppetBase:
47     type: ../../puppet/services/octavia-housekeeping.yaml
48     properties:
49       EndpointMap: {get_param: EndpointMap}
50       ServiceData: {get_param: ServiceData}
51       ServiceNetMap: {get_param: ServiceNetMap}
52       DefaultPasswords: {get_param: DefaultPasswords}
53       RoleName: {get_param: RoleName}
54       RoleParameters: {get_param: RoleParameters}
55
56 outputs:
57   role_data:
58     description: Role data for the Octavia housekeeping role.
59     value:
60       service_name: {get_attr: [OctaviaHousekeepingPuppetBase, role_data, service_name]}
61       config_settings: {get_attr: [OctaviaHousekeepingPuppetBase, role_data, config_settings]}
62       step_config: &step_config
63         get_attr: [OctaviaHousekeepingPuppetBase, role_data, step_config]
64       service_config_settings: {get_attr: [OctaviaHousekeepingPuppetBase, role_data, service_config_settings]}
65       # BEGIN DOCKER SETTINGS #
66       puppet_config:
67         config_volume: octavia
68         puppet_tags: octavia_config
69         step_config: *step_config
70         config_image: {get_param: DockerOctaviaConfigImage}
71       kolla_config:
72         /var/lib/kolla/config_files/octavia_housekeeping.json:
73           command: /usr/bin/octavia-housekeeping --config-file /usr/share/octavia/octavia-dist.conf --config-file /etc/octavia/octavia.conf --log-file /var/log/octavia/housekeeping.log --config-dir /etc/octavia/conf.d/common --config-dir /etc/octavia/conf.d/octavia-housekeeping
74           config_files:
75             - source: "/var/lib/kolla/config_files/src/*"
76               dest: "/"
77               merge: true
78               preserve_properties: true
79       docker_config:
80         step_2:
81           octavia_housekeeping_init_dirs:
82             start_order: 0
83             image: &octavia_housekeeping_image {get_param: DockerOctaviaHousekeepingImage}
84             user: root
85             volumes:
86               # NOTE(mandre) we need extra dir for the service in /etc/octavia/conf.d
87               # It is normally created as part of the RPM install, but it is
88               # missing here because we use the same config_volume for all
89               # octavia services, hence the same container image to generate
90               # configuration.
91               - /var/lib/config-data/puppet-generated/octavia/etc/octavia:/etc/octavia/
92             command: ['/bin/bash', '-c', 'mkdir -p /etc/octavia/conf.d/octavia-housekeeping; chown -R octavia:octavia /etc/octavia/conf.d/octavia-housekeeping']
93         step_4:
94           octavia_housekeeping:
95             start_order: 2
96             image: *octavia_housekeeping_image
97             net: host
98             privileged: false
99             restart: always
100             volumes:
101               list_concat:
102                 - {get_attr: [ContainersCommon, volumes]}
103                 -
104                   - /var/lib/kolla/config_files/octavia_housekeeping.json:/var/lib/kolla/config_files/config.json:ro
105                   - /var/lib/config-data/puppet-generated/octavia/:/var/lib/kolla/config_files/src:ro
106                   - /var/log/containers/octavia:/var/log/octavia
107             environment:
108               - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
109       host_prep_tasks:
110         - name: create persistent logs directory
111           file:
112             path: /var/log/containers/octavia
113             state: directory
114       upgrade_tasks:
115         - name: Stop and disable octavia_housekeeping service
116           tags: step2
117           service: name=openstack-octavia-housekeeping state=stopped enabled=no