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 logging_source: {get_attr: [OctaviaApiPuppetBase, role_data, logging_source]}
73 logging_groups: {get_attr: [OctaviaApiPuppetBase, role_data, logging_groups]}
74 step_config: &step_config
77 - - {get_attr: [OctaviaApiPuppetBase, role_data, step_config]}
78 - {get_attr: [MySQLClient, role_data, step_config]}
79 service_config_settings: {get_attr: [OctaviaApiPuppetBase, role_data, service_config_settings]}
80 # BEGIN DOCKER SETTINGS #
82 config_volume: octavia
83 puppet_tags: octavia_config
84 step_config: *step_config
85 config_image: {get_param: DockerOctaviaConfigImage}
87 /var/lib/kolla/config_files/octavia_api.json:
88 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
90 - source: "/var/lib/kolla/config_files/src/*"
93 preserve_properties: true
94 /var/lib/kolla/config_files/octavia_api_tls_proxy.json:
95 command: /usr/sbin/httpd -DFOREGROUND
97 - source: "/var/lib/kolla/config_files/src/*"
100 preserve_properties: true
102 # Kolla_bootstrap/db_sync runs before permissions set by kolla_config
104 octavia_api_init_dirs:
106 image: &octavia_api_image {get_param: DockerOctaviaApiImage}
109 # NOTE(mandre) we need extra dir for the service in /etc/octavia/conf.d
110 # It is normally created as part of the RPM install, but it is
111 # missing here because we use the same config_volume for all
112 # octavia services, hence the same container image to generate
114 - /var/lib/config-data/puppet-generated/octavia/etc/octavia:/etc/octavia/
115 - /var/log/containers/octavia:/var/log/octavia
116 - /var/log/containers/httpd/octavia-api:/var/log/httpd
117 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']
121 image: *octavia_api_image
128 - {get_attr: [ContainersCommon, volumes]}
130 - /var/lib/config-data/octavia/etc/octavia/:/etc/octavia/:ro
131 - /var/log/containers/octavia:/var/log/octavia
132 - /var/log/containers/httpd/octavia-api:/var/log/httpd
133 command: "/usr/bin/bootstrap_host_exec octavia_api su octavia -s /bin/bash -c '/usr/bin/octavia-db-manage upgrade head'"
138 image: *octavia_api_image
144 - {get_attr: [ContainersCommon, volumes]}
146 - /var/lib/kolla/config_files/octavia_api.json:/var/lib/kolla/config_files/config.json:ro
147 - /var/lib/config-data/puppet-generated/octavia/:/var/lib/kolla/config_files/src:ro
148 - /var/log/containers/octavia:/var/log/octavia
149 - /var/log/containers/httpd/octavia-api:/var/log/httpd
151 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
153 - internal_tls_enabled
154 - octavia_api_tls_proxy:
156 image: *octavia_api_image
162 - {get_attr: [ContainersCommon, volumes]}
164 - /var/lib/kolla/config_files/octavia_api_tls_proxy.json:/var/lib/kolla/config_files/config.json:ro
165 - /var/lib/config-data/puppet-generated/octavia/:/var/lib/kolla/config_files/src:ro
166 - /etc/pki/tls/certs/httpd:/etc/pki/tls/certs/httpd:ro
167 - /etc/pki/tls/private/httpd:/etc/pki/tls/private/httpd:ro
169 - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
172 - name: create persistent logs directory
177 - /var/log/containers/octavia
178 - /var/log/containers/httpd/octavia-api
180 - name: Stop and disable octavia_api service
182 service: name=openstack-octavia-api state=stopped enabled=no