From 73cedbc8511dd4cd85309bc2beda5d6e838e4f92 Mon Sep 17 00:00:00 2001 From: Carlos Goncalves Date: Wed, 10 Oct 2018 11:04:52 +0100 Subject: [PATCH] Move set of database_connection to OctaviaBase Other Octavia services like octavia-worker also require setting of database connection in order to access the octavia database. Closes-Bug: #1797098 Depends-On: https://review.openstack.org/#/c/612395/ Change-Id: I33a08521a4cfffc709de850b99f9292ca464537e --- docker/services/octavia-health-manager.yaml | 8 +++++++- docker/services/octavia-housekeeping.yaml | 8 +++++++- docker/services/octavia-worker.yaml | 4 ++++ puppet/services/octavia-api.yaml | 10 ---------- puppet/services/octavia-base.yaml | 10 ++++++++++ 5 files changed, 28 insertions(+), 12 deletions(-) diff --git a/docker/services/octavia-health-manager.yaml b/docker/services/octavia-health-manager.yaml index dbf3424150..77f572b904 100644 --- a/docker/services/octavia-health-manager.yaml +++ b/docker/services/octavia-health-manager.yaml @@ -51,6 +51,9 @@ resources: ContainersCommon: type: ./containers-common.yaml + MySQLClient: + type: ../../puppet/services/database/mysql-client.yaml + OctaviaHealthManagerPuppetBase: type: ../../puppet/services/octavia-health-manager.yaml properties: @@ -80,7 +83,10 @@ outputs: config_volume: octavia puppet_tags: octavia_config step_config: - get_attr: [OctaviaHealthManagerPuppetBase, role_data, step_config] + list_join: + - "\n" + - - {get_attr: [OctaviaHealthManagerPuppetBase, role_data, step_config]} + - {get_attr: [MySQLClient, role_data, step_config]} config_image: {get_param: DockerOctaviaConfigImage} kolla_config: /var/lib/kolla/config_files/octavia_health_manager.json: diff --git a/docker/services/octavia-housekeeping.yaml b/docker/services/octavia-housekeeping.yaml index 96c74f1bd6..d3d36dca66 100644 --- a/docker/services/octavia-housekeeping.yaml +++ b/docker/services/octavia-housekeeping.yaml @@ -47,6 +47,9 @@ resources: ContainersCommon: type: ./containers-common.yaml + MySQLClient: + type: ../../puppet/services/database/mysql-client.yaml + OctaviaHousekeepingPuppetBase: type: ../../puppet/services/octavia-housekeeping.yaml properties: @@ -76,7 +79,10 @@ outputs: config_volume: octavia puppet_tags: octavia_config step_config: - get_attr: [OctaviaHousekeepingPuppetBase, role_data, step_config] + list_join: + - "\n" + - - {get_attr: [OctaviaHousekeepingPuppetBase, role_data, step_config]} + - {get_attr: [MySQLClient, role_data, step_config]} config_image: {get_param: DockerOctaviaConfigImage} kolla_config: /var/lib/kolla/config_files/octavia_housekeeping.json: diff --git a/docker/services/octavia-worker.yaml b/docker/services/octavia-worker.yaml index c45028a842..86657cea73 100644 --- a/docker/services/octavia-worker.yaml +++ b/docker/services/octavia-worker.yaml @@ -51,6 +51,9 @@ resources: ContainersCommon: type: ./containers-common.yaml + MySQLClient: + type: ../../puppet/services/database/mysql-client.yaml + OctaviaWorkerPuppetBase: type: ../../puppet/services/octavia-worker.yaml properties: @@ -84,6 +87,7 @@ outputs: - "\n" - - "['nova_flavor'].each |String $val| { noop_resource($val) }" - {get_attr: [OctaviaWorkerPuppetBase, role_data, step_config]} + - {get_attr: [MySQLClient, role_data, step_config]} config_image: {get_param: DockerOctaviaConfigImage} kolla_config: /var/lib/kolla/config_files/octavia_worker.json: diff --git a/puppet/services/octavia-api.yaml b/puppet/services/octavia-api.yaml index c9e7b6f368..3d4d69391c 100644 --- a/puppet/services/octavia-api.yaml +++ b/puppet/services/octavia-api.yaml @@ -103,16 +103,6 @@ outputs: - octavia::keystone::authtoken::www_authenticate_uri: {get_param: [EndpointMap, KeystoneInternal, uri] } octavia::keystone::authtoken::auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri] } octavia::policy::policies: {get_param: OctaviaApiPolicies} - octavia::db::database_connection: - make_url: - scheme: {get_param: [EndpointMap, MysqlInternal, protocol]} - username: {get_param: OctaviaUserName} - password: {get_param: OctaviaPassword} - host: {get_param: [EndpointMap, MysqlInternal, host]} - path: /octavia - query: - read_default_file: /etc/my.cnf.d/tripleo.cnf - read_default_group: tripleo octavia::keystone::authtoken::auth_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]} octavia::keystone::authtoken::project_name: {get_param: OctaviaProjectName} octavia::keystone::authtoken::password: {get_param: OctaviaPassword} diff --git a/puppet/services/octavia-base.yaml b/puppet/services/octavia-base.yaml index c619cf996d..9e3c4f18d9 100644 --- a/puppet/services/octavia-base.yaml +++ b/puppet/services/octavia-base.yaml @@ -126,6 +126,16 @@ outputs: - {get_param: OctaviaDebug } octavia::purge_config: {get_param: EnableConfigPurge} octavia::notification_driver: {get_param: NotificationDriver} + octavia::db::database_connection: + make_url: + scheme: {get_param: [EndpointMap, MysqlInternal, protocol]} + username: {get_param: OctaviaUserName} + password: {get_param: OctaviaPassword} + host: {get_param: [EndpointMap, MysqlInternal, host]} + path: /octavia + query: + read_default_file: /etc/my.cnf.d/tripleo.cnf + read_default_group: tripleo # TODO(ansmith): remove once p-t-o switches to oslo params octavia::rabbit_use_ssl: {get_param: RpcUseSSL} octavia::rabbit_userid: {get_param: RpcUserName}