1 heat_template_version: pike
4 OpenStack Octavia service configured with Puppet
10 DockerOctaviaConfigImage:
11 description: The container image to use for the octavia config_volume
15 description: Mapping of service endpoint -> protocol. Typically set
16 via parameter_defaults in the resource registry.
20 description: Dictionary packing service data
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.
33 description: Role name on which the service is applied
37 description: Parameters specific to the role
45 internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
51 type: ./containers-common.yaml
54 type: ../../puppet/services/database/mysql-client.yaml
57 type: ../../puppet/services/octavia-api.yaml
59 EndpointMap: {get_param: EndpointMap}
60 ServiceData: {get_param: ServiceData}
61 ServiceNetMap: {get_param: ServiceNetMap}
62 DefaultPasswords: {get_param: DefaultPasswords}
63 RoleName: {get_param: RoleName}
64 RoleParameters: {get_param: RoleParameters}
68 description: Role data for the Octavia API role.
70 service_name: {get_attr: [OctaviaApiPuppetBase, role_data, service_name]}
71 config_settings: {get_attr: [OctaviaApiPuppetBase, role_data, config_settings]}
72 step_config: &step_config
75 - - {get_attr: [OctaviaApiPuppetBase, role_data, step_config]}
76 - {get_attr: [MySQLClient, role_data, step_config]}
77 service_config_settings: {get_attr: [OctaviaApiPuppetBase, role_data, service_config_settings]}
78 # BEGIN DOCKER SETTINGS #
80 config_volume: octavia
81 puppet_tags: octavia_config
82 step_config: *step_config
83 config_image: {get_param: DockerOctaviaConfigImage}
85 /var/lib/kolla/config_files/octavia_api.json:
86 command: /usr/bin/octavia-api --config-file /usr/share/octavia/octavia-dist.conf --config-file /etc/octavia/octavia.conf --log-file /var/log/octavia/api.log --config-dir /etc/octavia/conf.d/common --config-dir /etc/octavia/conf.d/octavia-api
88 - source: "/var/lib/kolla/config_files/src/*"
91 preserve_properties: true
92 /var/lib/kolla/config_files/octavia_api_tls_proxy.json:
93 command: /usr/sbin/httpd -DFOREGROUND
95 - source: "/var/lib/kolla/config_files/src/*"
98 preserve_properties: true
100 # Kolla_bootstrap/db_sync runs before permissions set by kolla_config
102 octavia_api_init_dirs:
104 image: &octavia_api_image {get_param: DockerOctaviaApiImage}
107 # NOTE(mandre) we need extra dir for the service in /etc/octavia/conf.d
108 # It is normally created as part of the RPM install, but it is
109 # missing here because we use the same config_volume for all
110 # octavia services, hence the same container image to generate
112 - /var/lib/config-data/puppet-generated/octavia/etc/octavia:/etc/octavia/
113 - /var/log/containers/octavia:/var/log/octavia
114 - /var/log/containers/httpd/octavia-api:/var/log/httpd
115 command: ['/bin/bash', '-c', 'mkdir -p /etc/octavia/conf.d/octavia-api; chown -R octavia:octavia /etc/octavia/conf.d/octavia-api; chown -R octavia:octavia /var/log/octavia']
119 image: *octavia_api_image
126 - {get_attr: [ContainersCommon, volumes]}
128 - /var/lib/config-data/octavia/etc/octavia/:/etc/octavia/:ro
129 - /var/log/containers/octavia:/var/log/octavia
130 - /var/log/containers/httpd/octavia-api:/var/log/httpd
131 command: "/usr/bin/bootstrap_host_exec octavia_api su octavia -s /bin/bash -c '/usr/bin/octavia-db-manage upgrade head'"
136 image: *octavia_api_image
142 - {get_attr: [ContainersCommon, volumes]}
144 - /var/lib/kolla/config_files/octavia_api.json:/var/lib/kolla/config_files/config.json:ro
145 - /var/lib/config-data/puppet-generated/octavia/:/var/lib/kolla/config_files/src:ro
146 - /var/log/containers/octavia:/var/log/octavia
147 - /var/log/containers/httpd/octavia-api:/var/log/httpd
149 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
151 - internal_tls_enabled
152 - octavia_api_tls_proxy:
154 image: *octavia_api_image
160 - {get_attr: [ContainersCommon, volumes]}
162 - /var/lib/kolla/config_files/octavia_api_tls_proxy.json:/var/lib/kolla/config_files/config.json:ro
163 - /var/lib/config-data/puppet-generated/octavia/:/var/lib/kolla/config_files/src:ro
164 - /etc/pki/tls/certs/httpd:/etc/pki/tls/certs/httpd:ro
165 - /etc/pki/tls/private/httpd:/etc/pki/tls/private/httpd:ro
167 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
170 - name: create persistent logs directory
175 - /var/log/containers/octavia
176 - /var/log/containers/httpd/octavia-api
178 - name: Stop and disable octavia_api service
180 service: name=openstack-octavia-api state=stopped enabled=no