step2: flatten the designate service configurations

This change combines the previous puppet and docker files into a single
file that performs the docker service installation and configuration
for the designate Producer, Worker, and Mdns services.

Change-Id: Ibbd14996eb6fc9b2e45dd9f24d3b7156c42da990
Related-Blueprint: services-yaml-flattening
This commit is contained in:
Dan Prince 2019-02-05 08:10:18 -05:00
parent afe1cb5581
commit 6090dc6677
14 changed files with 157 additions and 353 deletions

View File

@ -16,9 +16,9 @@ resource_registry:
OS::TripleO::Services::MySQL: ../../docker/services/pacemaker/database/mysql.yaml
OS::TripleO::Services::DesignateApi: ../../deployment/designate/designate-api-container-puppet.yaml
OS::TripleO::Services::DesignateCentral: ../../deployment/designate/designate-central-container-puppet.yaml
OS::TripleO::Services::DesignateProducer: ../../docker/services/designate-producer.yaml
OS::TripleO::Services::DesignateWorker: ../../docker/services/designate-worker.yaml
OS::TripleO::Services::DesignateMDNS: ../../docker/services/designate-mdns.yaml
OS::TripleO::Services::DesignateProducer: ../../deployment/designate/designate-producer-container-puppet.yaml
OS::TripleO::Services::DesignateWorker: ../../deployment/designate/designate-worker-container-puppet.yaml
OS::TripleO::Services::DesignateMDNS: ../../deployment/designate/designate-mdns-container-puppet.yaml
OS::TripleO::Services::Keepalived: OS::Heat::None
# Some infra instances don't pass the ping test but are otherwise working.
# Since the OVB jobs also test this functionality we can shut it off here.

View File

@ -21,9 +21,9 @@ resource_registry:
OS::TripleO::Services::MySQL: ../../docker/services/pacemaker/database/mysql.yaml
OS::TripleO::Services::DesignateApi: ../../deployment/designate/designate-api-container-puppet.yaml
OS::TripleO::Services::DesignateCentral: ../../deployment/designate/designate-central-container-puppet.yaml
OS::TripleO::Services::DesignateProducer: ../../docker/services/designate-producer.yaml
OS::TripleO::Services::DesignateWorker: ../../docker/services/designate-worker.yaml
OS::TripleO::Services::DesignateMDNS: ../../docker/services/designate-mdns.yaml
OS::TripleO::Services::DesignateProducer: ../../deployment/designate/designate-producer-container-puppet.yaml
OS::TripleO::Services::DesignateWorker: ../../deployment/designate/designate-worker-container-puppet.yaml
OS::TripleO::Services::DesignateMDNS: ../../deployment/designate/designate-mdns-container-puppet.yaml
# Some infra instances don't pass the ping test but are otherwise working.
# Since the OVB jobs also test this functionality we can shut it off here.
OS::TripleO::AllNodes::Validation: ../common/all-nodes-validation-disabled.yaml

View File

@ -65,7 +65,7 @@ resources:
type: ../../docker/services/containers-common.yaml
DesignateBase:
type: ../../puppet/services/designate-base.yaml
type: ./designate-base.yaml
properties:
EndpointMap: {get_param: EndpointMap}
ServiceData: {get_param: ServiceData}

View File

@ -63,7 +63,7 @@ resources:
type: ../database/mysql-client.yaml
DesignateBase:
type: ../../puppet/services/designate-base.yaml
type: ./designate-base.yaml
properties:
EndpointMap: {get_param: EndpointMap}
ServiceData: {get_param: ServiceData}

View File

@ -36,28 +36,31 @@ parameters:
default: {}
description: Parameters specific to the role
type: json
MonitoringSubscriptionDesignateMiniDNS:
default: 'overcloud-designate-mdns'
type: string
DesignateWorkers:
default: 0
description: Number of workers for Designate services.
type: number
DesignatePassword:
description: The password for the Designate's database account.
type: string
hidden: true
conditions:
designate_workers_zero: {equals : [{get_param: DesignateWorkers}, 0]}
resources:
ContainersCommon:
type: ./containers-common.yaml
type: ../../docker/services/containers-common.yaml
MySQLClient:
type: ../../deployment/database/mysql-client.yaml
type: ../database/mysql-client.yaml
DesignateBase:
type: ../../puppet/services/designate-base.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}
DesignateMDNSBase:
type: ../../puppet/services/designate-mdns.yaml
type: ./designate-base.yaml
properties:
EndpointMap: {get_param: EndpointMap}
ServiceData: {get_param: ServiceData}
@ -70,12 +73,44 @@ outputs:
role_data:
description: Role data for the Designate MDNS role.
value:
service_name: {get_attr: [DesignateMDNSBase, role_data, service_name]}
service_name: designate_mdns
monitoring_subscription: {get_param: MonitoringSubscriptionDesignateMiniDNS}
config_settings:
map_merge:
- get_attr: [DesignateBase, role_data, config_settings]
- get_attr: [DesignateMDNSBase, role_data, config_settings]
service_config_settings: {get_attr: [DesignateMDNSBase, role_data, service_config_settings]}
- designate::db::database_connection:
make_url:
scheme: {get_param: [EndpointMap, MysqlInternal, protocol]}
username: designate
password: {get_param: DesignatePassword}
host: {get_param: [EndpointMap, MysqlInternal, host]}
path: /designate
query:
read_default_file: /etc/my.cnf.d/tripleo.cnf
read_default_group: tripleo
tripleo::designate_mdns::firewall_rules:
'142 designate_mdns udp':
proto: 'udp'
dport:
- 5354
'143 designate_mdns tcp':
proto: 'tcp'
dport:
- 5354
-
if:
- designate_workers_zero
- {}
- designate::mdns::workers: {get_param: DesignateWorkers}
service_config_settings:
mysql:
designate::db::mysql::password: {get_param: DesignatePassword}
designate::db::mysql::user: designate
designate::db::mysql::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
designate::db::mysql::dbname: designate
designate::db::mysql::allowed_hosts:
- '%'
- "%{hiera('mysql_bind_host')}"
# BEGIN DOCKER SETTINGS
puppet_config:
config_volume: designate
@ -84,7 +119,7 @@ outputs:
list_join:
- "\n"
- - {get_attr: [DesignateBase, role_data, step_config]}
- {get_attr: [DesignateMDNSBase, role_data, step_config]}
- "include tripleo::profile::base::designate::mdns"
- {get_attr: [MySQLClient, role_data, step_config]}
config_image: {get_param: DockerDesignateConfigImage}
kolla_config:

View File

@ -41,25 +41,24 @@ parameters:
default: {}
description: Parameters specific to the role
type: json
MonitoringSubscriptionDesignateProducer:
default: 'overcloud-designate-producer'
type: string
DesignateWorkers:
default: 0
description: Number of workers for Designate services.
type: number
conditions:
designate_workers_zero: {equals : [{get_param: DesignateWorkers}, 0]}
resources:
ContainersCommon:
type: ./containers-common.yaml
type: ../../docker/services/containers-common.yaml
DesignateBase:
type: ../../puppet/services/designate-base.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}
DesignateProducerBase:
type: ../../puppet/services/designate-producer.yaml
type: ./designate-base.yaml
properties:
EndpointMap: {get_param: EndpointMap}
ServiceData: {get_param: ServiceData}
@ -72,12 +71,17 @@ outputs:
role_data:
description: Role data for the Designate Producer role.
value:
service_name: {get_attr: [DesignateProducerBase, role_data, service_name]}
service_name: designate_producer
monitoring_subscription: {get_param: MonitoringSubscriptionDesignateProducer}
config_settings:
map_merge:
- get_attr: [DesignateBase, role_data, config_settings]
- get_attr: [DesignateProducerBase, role_data, config_settings]
service_config_settings: {get_attr: [DesignateProducerBase, role_data, service_config_settings]}
-
if:
- designate_workers_zero
- {}
- designate::producer::workers: {get_param: DesignateWorkers}
service_config_settings: {}
# BEGIN DOCKER SETTINGS
puppet_config:
config_volume: designate
@ -86,7 +90,7 @@ outputs:
list_join:
- "\n"
- - {get_attr: [DesignateBase, role_data, step_config]}
- {get_attr: [DesignateProducerBase, role_data, step_config]}
- "include tripleo::profile::base::designate::producer"
config_image: {get_param: DockerDesignateConfigImage}
kolla_config:
/var/lib/kolla/config_files/designate_producer.json:

View File

@ -53,7 +53,7 @@ resources:
type: ../../docker/services/containers-common.yaml
DesignateBase:
type: ../../puppet/services/designate-base.yaml
type: ./designate-base.yaml
properties:
EndpointMap: {get_param: EndpointMap}
ServiceData: {get_param: ServiceData}

View File

@ -44,25 +44,28 @@ parameters:
default: {}
description: Parameters specific to the role
type: json
MonitoringSubscriptionDesignateWorker:
default: 'overcloud-designate-worker'
type: string
DesignateWorkers:
default: 0
description: Number of workers for Designate services.
type: number
DesignateRndcKey:
description: The rndc key secret for communication with BIND.
type: string
hidden: true
conditions:
designate_workers_zero: {equals : [{get_param: DesignateWorkers}, 0]}
resources:
ContainersCommon:
type: ./containers-common.yaml
type: ../../docker/services/containers-common.yaml
DesignateBase:
type: ../../puppet/services/designate-base.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}
DesignateWorkerBase:
type: ../../puppet/services/designate-worker.yaml
type: ./designate-base.yaml
properties:
EndpointMap: {get_param: EndpointMap}
ServiceData: {get_param: ServiceData}
@ -75,12 +78,63 @@ outputs:
role_data:
description: Role data for the Designate Worker role.
value:
service_name: {get_attr: [DesignateWorkerBase, role_data, service_name]}
service_name: designate_worker
monitoring_subscription: {get_param: MonitoringSubscriptionDesignateWorker}
config_settings:
map_merge:
- get_attr: [DesignateBase, role_data, config_settings]
- get_attr: [DesignateWorkerBase, role_data, config_settings]
service_config_settings: {get_attr: [DesignateWorkerBase, role_data, service_config_settings]}
- designate::worker::worker_notify: true
designate_rndc_key: {get_param: DesignateRndcKey}
dns::vardir: /var/named-persistent
dns::recursion: 'no'
# Because we generate the key locally and don't want the puppet
# module to do it, we set its path to /dev/null. This means we need
# to explicitly include /etc/rndc.key though since the default config
# will just include /dev/null.
dns::rndckeypath: /dev/null
dns::additional_directives:
- include "/etc/rndc.key";
dns::additional_options:
listen-on:
str_replace:
template:
"{ %{hiera('$NETWORK')}; }"
params:
$NETWORK: {get_param: [ServiceNetMap, BINDNetwork]}
tripleo::profile::base::designate::rndc_host:
str_replace:
template:
"%{hiera('$NETWORK')}"
params:
$NETWORK: {get_param: [ServiceNetMap, DesignateApiNetwork]}
tripleo::profile::base::designate::rndc_allowed_addresses:
get_param:
- ServiceData
- net_cidr_map
- {get_param: [ServiceNetMap, DesignateApiNetwork]}
designate::backend::bind9::rndc_host:
str_replace:
template:
"%{hiera('$NETWORK')}"
params:
$NETWORK: {get_param: [ServiceNetMap, DesignateApiNetwork]}
tripleo::designate_worker::firewall_rules:
'140 designate_worker udp':
proto: 'udp'
dport:
- 53
- 953
'141 designate_worker tcp':
proto: 'tcp'
dport:
- 53
- 953
-
if:
- designate_workers_zero
- {}
- designate::worker::workers: {get_param: DesignateWorkers}
service_config_settings: {}
# BEGIN DOCKER SETTINGS
puppet_config:
config_volume: designate
@ -89,7 +143,7 @@ outputs:
list_join:
- "\n"
- - {get_attr: [DesignateBase, role_data, step_config]}
- {get_attr: [DesignateWorkerBase, role_data, step_config]}
- "include tripleo::profile::base::designate::worker"
- include ::designate::backend::bind9
config_image: {get_param: DockerDesignateConfigImage}
kolla_config:

View File

@ -14,6 +14,6 @@
resource_registry:
OS::TripleO::Services::DesignateApi: ../deployment/designate/designate-api-container-puppet.yaml
OS::TripleO::Services::DesignateCentral: ../deployment/designate/designate-central-container-puppet.yaml
OS::TripleO::Services::DesignateMDNS: ../docker/services/designate-mdns.yaml
OS::TripleO::Services::DesignateProducer: ../docker/services/designate-producer.yaml
OS::TripleO::Services::DesignateWorker: ../docker/services/designate-worker.yaml
OS::TripleO::Services::DesignateMDNS: ../deployment/designate/designate-mdns-container-puppet.yaml
OS::TripleO::Services::DesignateProducer: ../deployment/designate/designate-producer-container-puppet.yaml
OS::TripleO::Services::DesignateWorker: ../deployment/designate/designate-worker-container-puppet.yaml

View File

@ -1,101 +0,0 @@
heat_template_version: rocky
description: >
OpenStack Designate MiniDNS service configured with Puppet
parameters:
ServiceData:
default: {}
description: Dictionary packing service data
type: json
ServiceNetMap:
default: {}
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry. This
mapping overrides those in ServiceNetMapDefaults.
type: json
DefaultPasswords:
default: {}
type: json
RoleName:
default: ''
description: Role name on which the service is applied
type: string
RoleParameters:
default: {}
description: Parameters specific to the role
type: json
EndpointMap:
default: {}
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
MonitoringSubscriptionDesignateMiniDNS:
default: 'overcloud-designate-mdns'
type: string
DesignateWorkers:
default: 0
description: Number of workers for Designate services.
type: number
DesignatePassword:
description: The password for the Designate's database account.
type: string
hidden: true
conditions:
designate_workers_zero: {equals : [{get_param: DesignateWorkers}, 0]}
resources:
DesignateBase:
type: ./designate-base.yaml
properties:
ServiceData: {get_param: ServiceData}
ServiceNetMap: {get_param: ServiceNetMap}
DefaultPasswords: {get_param: DefaultPasswords}
EndpointMap: {get_param: EndpointMap}
RoleName: {get_param: RoleName}
RoleParameters: {get_param: RoleParameters}
outputs:
role_data:
description: Role data for the Designate MiniDNS service.
value:
service_name: designate_mdns
monitoring_subscription: {get_param: MonitoringSubscriptionDesignateMiniDNS}
config_settings:
map_merge:
- get_attr: [DesignateBase, role_data, config_settings]
- designate::db::database_connection:
make_url:
scheme: {get_param: [EndpointMap, MysqlInternal, protocol]}
username: designate
password: {get_param: DesignatePassword}
host: {get_param: [EndpointMap, MysqlInternal, host]}
path: /designate
query:
read_default_file: /etc/my.cnf.d/tripleo.cnf
read_default_group: tripleo
tripleo::designate_mdns::firewall_rules:
'142 designate_mdns udp':
proto: 'udp'
dport:
- 5354
'143 designate_mdns tcp':
proto: 'tcp'
dport:
- 5354
-
if:
- designate_workers_zero
- {}
- designate::mdns::workers: {get_param: DesignateWorkers}
step_config: |
include tripleo::profile::base::designate::mdns
service_config_settings:
mysql:
designate::db::mysql::password: {get_param: DesignatePassword}
designate::db::mysql::user: designate
designate::db::mysql::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
designate::db::mysql::dbname: designate
designate::db::mysql::allowed_hosts:
- '%'
- "%{hiera('mysql_bind_host')}"

View File

@ -1,69 +0,0 @@
heat_template_version: rocky
description: >
OpenStack Designate Producer service configured with Puppet
parameters:
ServiceData:
default: {}
description: Dictionary packing service data
type: json
ServiceNetMap:
default: {}
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry. This
mapping overrides those in ServiceNetMapDefaults.
type: json
DefaultPasswords:
default: {}
type: json
RoleName:
default: ''
description: Role name on which the service is applied
type: string
RoleParameters:
default: {}
description: Parameters specific to the role
type: json
EndpointMap:
default: {}
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
MonitoringSubscriptionDesignateProducer:
default: 'overcloud-designate-producer'
type: string
DesignateWorkers:
default: 0
description: Number of workers for Designate services.
type: number
conditions:
designate_workers_zero: {equals : [{get_param: DesignateWorkers}, 0]}
resources:
DesignateBase:
type: ./designate-base.yaml
properties:
ServiceData: {get_param: ServiceData}
ServiceNetMap: {get_param: ServiceNetMap}
DefaultPasswords: {get_param: DefaultPasswords}
EndpointMap: {get_param: EndpointMap}
RoleName: {get_param: RoleName}
RoleParameters: {get_param: RoleParameters}
outputs:
role_data:
description: Role data for the Designate Producer service.
value:
service_name: designate_producer
monitoring_subscription: {get_param: MonitoringSubscriptionDesignateProducer}
config_settings:
map_merge:
- get_attr: [DesignateBase, role_data, config_settings]
-
if:
- designate_workers_zero
- {}
- designate::producer::workers: {get_param: DesignateWorkers}
step_config: |
include tripleo::profile::base::designate::producer

View File

@ -1,119 +0,0 @@
heat_template_version: rocky
description: >
OpenStack Designate Worker service configured with Puppet
parameters:
ServiceData:
default: {}
description: Dictionary packing service data
type: json
ServiceNetMap:
default: {}
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry. This
mapping overrides those in ServiceNetMapDefaults.
type: json
DefaultPasswords:
default: {}
type: json
RoleName:
default: ''
description: Role name on which the service is applied
type: string
RoleParameters:
default: {}
description: Parameters specific to the role
type: json
EndpointMap:
default: {}
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
MonitoringSubscriptionDesignateWorker:
default: 'overcloud-designate-worker'
type: string
DesignateWorkers:
default: 0
description: Number of workers for Designate services.
type: number
DesignateRndcKey:
description: The rndc key secret for communication with BIND.
type: string
hidden: true
conditions:
designate_workers_zero: {equals : [{get_param: DesignateWorkers}, 0]}
resources:
DesignateBase:
type: ./designate-base.yaml
properties:
ServiceData: {get_param: ServiceData}
ServiceNetMap: {get_param: ServiceNetMap}
DefaultPasswords: {get_param: DefaultPasswords}
EndpointMap: {get_param: EndpointMap}
RoleName: {get_param: RoleName}
RoleParameters: {get_param: RoleParameters}
outputs:
role_data:
description: Role data for the Designate Worker service.
value:
service_name: designate_worker
monitoring_subscription: {get_param: MonitoringSubscriptionDesignateWorker}
config_settings:
map_merge:
- get_attr: [DesignateBase, role_data, config_settings]
- designate::worker::worker_notify: true
designate_rndc_key: {get_param: DesignateRndcKey}
dns::vardir: /var/named-persistent
dns::recursion: 'no'
# Because we generate the key locally and don't want the puppet
# module to do it, we set its path to /dev/null. This means we need
# to explicitly include /etc/rndc.key though since the default config
# will just include /dev/null.
dns::rndckeypath: /dev/null
dns::additional_directives:
- include "/etc/rndc.key";
dns::additional_options:
listen-on:
str_replace:
template:
"{ %{hiera('$NETWORK')}; }"
params:
$NETWORK: {get_param: [ServiceNetMap, BINDNetwork]}
tripleo::profile::base::designate::rndc_host:
str_replace:
template:
"%{hiera('$NETWORK')}"
params:
$NETWORK: {get_param: [ServiceNetMap, DesignateApiNetwork]}
tripleo::profile::base::designate::rndc_allowed_addresses:
get_param:
- ServiceData
- net_cidr_map
- {get_param: [ServiceNetMap, DesignateApiNetwork]}
designate::backend::bind9::rndc_host:
str_replace:
template:
"%{hiera('$NETWORK')}"
params:
$NETWORK: {get_param: [ServiceNetMap, DesignateApiNetwork]}
tripleo::designate_worker::firewall_rules:
'140 designate_worker udp':
proto: 'udp'
dport:
- 53
- 953
'141 designate_worker tcp':
proto: 'tcp'
dport:
- 53
- 953
-
if:
- designate_workers_zero
- {}
- designate::worker::workers: {get_param: DesignateWorkers}
step_config: |
include tripleo::profile::base::designate::worker

View File

@ -13,9 +13,9 @@ environments:
resource_registry:
OS::TripleO::Services::DesignateApi: ../deployment/designate/designate-api-container-puppet.yaml
OS::TripleO::Services::DesignateCentral: ../deployment/designate/designate-central-container-puppet.yaml
OS::TripleO::Services::DesignateProducer: ../docker/services/designate-producer.yaml
OS::TripleO::Services::DesignateWorker: ../docker/services/designate-worker.yaml
OS::TripleO::Services::DesignateMDNS: ../docker/services/designate-mdns.yaml
OS::TripleO::Services::DesignateProducer: ../deployment/designate/designate-producer-container-puppet.yaml
OS::TripleO::Services::DesignateWorker: ../deployment/designate/designate-worker-container-puppet.yaml
OS::TripleO::Services::DesignateMDNS: ../deployment/designate/designate-mdns-container-puppet.yaml
-
name: designate-config
title: Configure Designate Parameters