From 25bc2a687b62e8ddb25f2f36425b6a7e605cb548 Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Tue, 29 Jan 2019 07:56:53 -0500 Subject: [PATCH] flatten the congress service This change combines the previous puppet and docker files into a single file that performs the docker service installation and configuration for the congress service. Change-Id: Ic39a7bca37a21ce01e1d185c1eb5c28c6aabb804 Related-Blueprint: services-yaml-flattening --- .../scenario007-multinode-containers.yaml | 2 +- .../congress/congress-container-puppet.yaml | 127 +++++++++++++++--- environments/enable_congress.yaml | 2 +- environments/services-baremetal/congress.yaml | 2 +- environments/services/congress.yaml | 2 +- 5 files changed, 115 insertions(+), 20 deletions(-) rename docker/services/congress.yaml => deployment/congress/congress-container-puppet.yaml (54%) diff --git a/ci/environments/scenario007-multinode-containers.yaml b/ci/environments/scenario007-multinode-containers.yaml index 4346996ff5..2838705dd2 100644 --- a/ci/environments/scenario007-multinode-containers.yaml +++ b/ci/environments/scenario007-multinode-containers.yaml @@ -15,7 +15,7 @@ resource_registry: # TODO(mandre) fix the tacker service - https://bugs.launchpad.net/tripleo/+bug/1714270 # OS::TripleO::Services::Tacker: ../../docker/services/tacker.yaml OS::TripleO::Services::Tacker: ../../puppet/services/tacker.yaml - OS::TripleO::Services::Congress: ../../docker/services/congress.yaml + OS::TripleO::Services::Congress: ../../deployment/congress/congress-container-puppet.yaml # environments/docker-ha.yaml enables the cinder service. So disable cinder services OS::TripleO::Services::CinderVolume: OS::Heat::None OS::TripleO::Services::CinderApi: OS::Heat::None diff --git a/docker/services/congress.yaml b/deployment/congress/congress-container-puppet.yaml similarity index 54% rename from docker/services/congress.yaml rename to deployment/congress/congress-container-puppet.yaml index 819fc7c9b4..308b85b005 100644 --- a/docker/services/congress.yaml +++ b/deployment/congress/congress-container-puppet.yaml @@ -40,34 +40,129 @@ parameters: default: false description: Remove package if the service is being disabled during upgrade type: boolean + CongressPassword: + description: The password for the congress service account. + type: string + hidden: true + Debug: + type: boolean + default: false + description: Set to True to enable debugging on all services. + CongressDebug: + default: '' + description: Set to True to enable debugging Congress service. + type: string + constraints: + - allowed_values: [ '', 'true', 'True', 'TRUE', 'false', 'False', 'FALSE'] + KeystoneRegion: + type: string + default: 'regionOne' + description: Keystone region for endpoint + CongressPolicies: + description: | + A hash of policies to configure for Congress. + e.g. { congress-context_is_admin: { key: context_is_admin, value: 'role:admin' } } + default: {} + type: json + NotificationDriver: + type: string + default: 'messagingv2' + description: Driver or drivers to handle sending notifications. + RpcPort: + default: 5672 + description: The network port for messaging backend + type: number + RpcUserName: + default: guest + description: The username for messaging backend + type: string + RpcPassword: + description: The password for messaging backend + type: string + hidden: true + RpcUseSSL: + default: false + description: > + Messaging client subscriber parameter to specify + an SSL connection to the messaging host. + type: string + +conditions: + service_debug_unset: {equals : [{get_param: CongressDebug}, '']} resources: ContainersCommon: - type: ./containers-common.yaml + type: ../../docker/services/containers-common.yaml MySQLClient: type: ../../deployment/database/mysql-client.yaml - CongressBase: - type: ../../puppet/services/congress.yaml - properties: - EndpointMap: {get_param: EndpointMap} - ServiceData: {get_param: ServiceData} - ServiceNetMap: {get_param: ServiceNetMap} - DefaultPasswords: {get_param: DefaultPasswords} - RoleName: {get_param: RoleName} - RoleParameters: {get_param: RoleParameters} - outputs: role_data: description: Role data for the Congress API role. value: - service_name: {get_attr: [CongressBase, role_data, service_name]} + service_name: congress config_settings: - map_merge: - - get_attr: [CongressBase, role_data, config_settings] - service_config_settings: {get_attr: [CongressBase, role_data, service_config_settings]} + congress_password: {get_param: CongressPassword} + congress::db::database_connection: + make_url: + scheme: {get_param: [EndpointMap, MysqlInternal, protocol]} + username: congress + password: {get_param: CongressPassword} + host: {get_param: [EndpointMap, MysqlInternal, host]} + path: /congress + query: + read_default_file: /etc/my.cnf.d/tripleo.cnf + read_default_group: tripleo + congress::logging::debug: + if: + - service_debug_unset + - {get_param: Debug } + - {get_param: CongressDebug } + congress::rpc_backend: rabbit + congress::notification_driver: {get_param: NotificationDriver} + # TODO(ansmith): remove once p-t-o switches to oslo params + congress::rabbit_userid: {get_param: RpcUserName} + congress::rabbit_password: {get_param: RpcPassword} + congress::rabbit_use_ssl: {get_param: RpcUseSSL} + congress::rabbit_port: {get_param: RpcPort} + congress::server::bind_host: + str_replace: + template: + "%{hiera('$NETWORK')}" + params: + $NETWORK: {get_param: [ServiceNetMap, CongressApiNetwork]} + + congress::keystone::authtoken::password: {get_param: CongressPassword} + congress::keystone::authtoken::project_name: 'service' + congress::keystone::authtoken::user_domain_name: 'Default' + congress::keystone::authtoken::project_domain_name: 'Default' + congress::keystone::authtoken::auth_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]} + congress::keystone::authtoken::www_authenticate_uri: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]} + congress::keystone::authtoken::auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]} + + congress::db::mysql::password: {get_param: CongressPassword} + congress::db::mysql::user: congress + congress::db::mysql::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]} + congress::db::mysql::dbname: congress + congress::db::mysql::allowed_hosts: + - '%' + - {get_param: [EndpointMap, MysqlInternal, host_nobrackets]} + congress::policy::policies: {get_param: CongressPolicies} + tripleo::congress::firewall_rules: + '113 congress': + dport: + - 1789 + - 13789 + service_config_settings: + keystone: + congress::keystone::auth::tenant: 'service' + congress::keystone::auth::region: {get_param: KeystoneRegion} + congress::keystone::auth::password: {get_param: CongressPassword} + congress::keystone::auth::public_url: {get_param: [EndpointMap, CongressPublic, uri]} + congress::keystone::auth::internal_url: {get_param: [EndpointMap, CongressInternal, uri]} + congress::keystone::auth::admin_url: {get_param: [EndpointMap, CongressAdmin, uri]} # BEGIN DOCKER SETTINGS puppet_config: config_volume: congress @@ -75,7 +170,7 @@ outputs: step_config: list_join: - "\n" - - - {get_attr: [CongressBase, role_data, step_config]} + - - "include ::tripleo::profile::base::congress" - {get_attr: [MySQLClient, role_data, step_config]} config_image: {get_param: DockerCongressConfigImage} kolla_config: diff --git a/environments/enable_congress.yaml b/environments/enable_congress.yaml index bf551cabc8..0688c76872 100644 --- a/environments/enable_congress.yaml +++ b/environments/enable_congress.yaml @@ -1,2 +1,2 @@ resource_registry: - OS::TripleO::Services::Congress: ../docker/services/congress.yaml + OS::TripleO::Services::Congress: ../deployment/congress/congress-container-puppet.yaml diff --git a/environments/services-baremetal/congress.yaml b/environments/services-baremetal/congress.yaml index d0cf29f6fd..b5199a90c6 100644 --- a/environments/services-baremetal/congress.yaml +++ b/environments/services-baremetal/congress.yaml @@ -1,2 +1,2 @@ resource_registry: - OS::TripleO::Services::Congress: ../../puppet/services/congress.yaml + OS::TripleO::Services::Congress: ../../deployment/congress/congress-container-puppet.yaml diff --git a/environments/services/congress.yaml b/environments/services/congress.yaml index e1edd3526f..b5199a90c6 100644 --- a/environments/services/congress.yaml +++ b/environments/services/congress.yaml @@ -1,2 +1,2 @@ resource_registry: - OS::TripleO::Services::Congress: ../../docker/services/congress.yaml + OS::TripleO::Services::Congress: ../../deployment/congress/congress-container-puppet.yaml