From 56d1e7e2bae553db9209400a4adf4155f86c5d4d Mon Sep 17 00:00:00 2001 From: Pedro Date: Mon, 20 Aug 2018 14:03:43 +0200 Subject: [PATCH] Adding designate worker and producer to Rocky Created class DesignateCharmRocky with designate worker and producer as part of package and service lists. Tested upgrade as follows: 1) run gate-basic-bionic-queens 2) juju config upgrades to bionic-rocky 3) run dev-basic-bionic-rocky Change-Id: I2b49ef7db272135b0796182bbe894a9611d96dea Closes-Bug: #1773190 --- src/lib/charm/openstack/designate.py | 25 ++ src/templates/rocky/designate.conf | 326 +++++++++++++++++++++++++++ src/tests/basic_deployment.py | 22 +- 3 files changed, 367 insertions(+), 6 deletions(-) create mode 100644 src/templates/rocky/designate.conf diff --git a/src/lib/charm/openstack/designate.py b/src/lib/charm/openstack/designate.py index 1b2c843..f3a2383 100644 --- a/src/lib/charm/openstack/designate.py +++ b/src/lib/charm/openstack/designate.py @@ -630,3 +630,28 @@ class DesignateCharmQueens(DesignateCharm): return 'blocked', ('Need either a dns-backend relation or ' 'config(dns-slaves) or both.') return None, None + + +# Inheriting from DesignateCharmQueens allows to keep +# enforcing nameservers' assignment while changing +# appropriate packages and services +class DesignateCharmRocky(DesignateCharmQueens): + + release = 'rocky' + packages = ['designate-agent', 'designate-api', 'designate-central', + 'designate-common', 'designate-mdns', + 'designate-worker', 'designate-sink', + 'designate-producer', 'bind9utils', 'python-apt'] + + services = ['designate-mdns', 'designate-producer', + 'designate-agent', 'designate-worker', + 'designate-central', 'designate-sink', + 'designate-api'] + + restart_map = { + '/etc/default/openstack': services, + '/etc/designate/designate.conf': services, + '/etc/designate/rndc.key': services, + '/etc/designate/pools.yaml': [''], + RC_FILE: [''], + } diff --git a/src/templates/rocky/designate.conf b/src/templates/rocky/designate.conf new file mode 100644 index 0000000..386612d --- /dev/null +++ b/src/templates/rocky/designate.conf @@ -0,0 +1,326 @@ +# Rocky +[DEFAULT] +# Where an option is commented out, but filled in this shows the default +# value of that optiona aaa + +######################## +## General Configuration +######################## +# Show more verbose log output (sets INFO log level output) +verbose = {{ options.verbose }} + +# Show debugging output in logs (sets DEBUG log level output) +debug = {{ options.debug }} + +# Top-level directory for maintaining designate's state +#state_path = /var/lib/designate + +# Log Configuration +#log_config = None + +# Log directory +#logdir = /var/log/designate + +# Use "sudo designate-rootwrap /etc/designate/rootwrap.conf" to use the real +# root filter facility. +# Change to "sudo" to skip the filtering and just run the comand directly +#root_helper = sudo designate-rootwrap /etc/designate/rootwrap.conf + +# Which networking API to use, Defaults to neutron +#network_api = neutron + +#----------------------- +# RabbitMQ Config +#----------------------- +{% include "parts/section-rabbitmq-oslo" %} + +######################## +## Service Configuration +######################## +#----------------------- +# Central Service +#----------------------- +[service:central] +# Number of central worker processes to spawn +workers = {{ options.workers }} + +# Number of central greenthreads to spawn +#threads = 1000 + +# Maximum domain name length +#max_domain_name_len = 255 + +# Maximum recordset name length +#max_recordset_name_len = 255 + +# Minimum TTL +#min_ttl = None + +# The name of the default pool +#default_pool_id = '794ccc2c-d751-44fe-b57f-8894c9f5c842' + +## Managed resources settings + +# Email to use for managed resources like domains created by the FloatingIP API +#managed_resource_email = hostmaster@example.com. + +# Tenant ID to own all managed resources - like auto-created records etc. +#managed_resource_tenant_id = 123456 + +#----------------------- +# API Service +#----------------------- +[service:api] +# Number of api worker processes to spawn +#workers = None + +# Number of api greenthreads to spawn +#threads = 1000 + +# Enable host request headers +enable_host_header = {{ options.enable_host_header }} + +# The base uri used in responses +api_base_uri = '{{ options.external_endpoints.designate_api.url }}' + +# Address to bind the API server +# NOTE:tinwood - Listen on every interface; fix for BUG #1734156 +api_host = 0.0.0.0 + +# Port the bind the API server to +api_port = '{{ options.service_listen_info.designate_api.port }}' + +# Maximum line size of message headers to be accepted. max_header_line may +# need to be increased when using large tokens (typically those generated by +# the Keystone v3 API with big service catalogs). +#max_header_line = 16384 + +# Authentication strategy to use - can be either "noauth" or "keystone" +#auth_strategy = keystone + +# Enable Version 1 API (deprecated) +enable_api_v1 = True + +# Enabled API Version 1 extensions +# Can be one or more of : diagnostics, quotas, reports, sync, touch +#enabled_extensions_v1 = +enabled_extensions_v1 = sync, touch + +# Enable Version 2 API +enable_api_v2 = True + +# Enabled API Version 2 extensions +#enabled_extensions_v2 = + +# Default per-page limit for the V2 API, a value of None means show all results +# by default +#default_limit_v2 = 20 + +# Max page size in the V2 API +#max_limit_v2 = 1000 + +# Enable Admin API (experimental) +#enable_api_admin = False +enable_api_admin = {{ options.enable_admin_api }} + +# Enabled Admin API extensions +# Can be one or more of : reports, quotas, counts, tenants, zones +# zone export is in zones extension +#enabled_extensions_admin = +{% if options.enable_admin_api -%} +enabled_extensions_admin = reports, quotas, counts, tenants, zones +{%- endif %} + +# Default per-page limit for the Admin API, a value of None means show all results +# by default +#default_limit_admin = 20 + +# Max page size in the Admin API +#max_limit_admin = 1000 + +# Show the pecan HTML based debug interface (v2 only) +# This is only useful for development, and WILL break python-designateclient +# if an error occurs +#pecan_debug = False + +#----------------------- +# Keystone Middleware +#----------------------- +{% include "parts/section-keystone-authtoken" %} + +#----------------------- +# Sink Service +#----------------------- +[service:sink] +# List of notification handlers to enable, configuration of these needs to +# correspond to a [handler:my_driver] section below or else in the config +# Can be one or more of : nova_fixed, neutron_floatingip +enabled_notification_handlers = {{ options.notification_handlers }} + +#----------------------- +# mDNS Service +#----------------------- +[service:mdns] +# Number of mdns worker processes to spawn +#workers = None + +# Number of mdns greenthreads to spawn +#threads = 1000 + +# mDNS Bind Host +#host = 0.0.0.0 + +# mDNS Port Number +#port = 5354 + +# mDNS TCP Backlog +#tcp_backlog = 100 + +# mDNS TCP Receive Timeout +#tcp_recv_timeout = 0.5 + +# Enforce all incoming queries (including AXFR) are TSIG signed +#query_enforce_tsig = False + +# Send all traffic over TCP +#all_tcp = False + +# Maximum message size to emit +#max_message_size = 65535 + +#----------------------- +# Agent Service +#----------------------- +[service:agent] +#workers = None +#host = 0.0.0.0 +#port = 5358 +#tcp_backlog = 100 +#allow_notify = 127.0.0.1 +#masters = 127.0.0.1:5354 +#backend_driver = fake +#transfer_source = None +#notify_delay = 0 + +#----------------------- +# Worker Service +#----------------------- +[service:worker] +enabled = True + +################################### +## Pool Manager Cache Configuration +################################### +#----------------------- +# SQLAlchemy Pool Manager Cache +#----------------------- +[pool_manager_cache:sqlalchemy] +connection = {{ shared_db.designate_pool_uri }} +#connection = sqlite:///$state_path/designate_pool_manager.sqlite +#connection_debug = 100 +#connection_trace = False +#sqlite_synchronous = True +#idle_timeout = 3600 +#max_retries = 10 +#retry_interval = 10 + +#----------------------- +# Memcache Pool Manager Cache +#----------------------- +[pool_manager_cache:memcache] +#memcached_servers = None +#expiration = 3600 + + +############## +## Network API +############## +[network_api:neutron] +# Comma separated list of values, formatted "|" +#endpoints = RegionOne|http://localhost:9696 +#endpoint_type = publicURL +#timeout = 30 +#admin_username = designate +#admin_password = designate +#admin_tenant_name = designate +#auth_url = http://localhost:35357/v2.0 +#insecure = False +#auth_strategy = keystone +#ca_certificates_file = + +######################## +## Storage Configuration +######################## +#----------------------- +# SQLAlchemy Storage +#----------------------- +[storage:sqlalchemy] +# Database connection string - to configure options for a given implementation +# like sqlalchemy or other see below +#connection = sqlite:///$state_path/designate.sqlite +connection = {{ shared_db.designate_uri }} +#connection_debug = 0 +#connection_trace = False +#sqlite_synchronous = True +#idle_timeout = 3600 +#max_retries = 10 +#retry_interval = 10 + +######################## +## Handler Configuration +######################## +#----------------------- +# Nova Fixed Handler +#----------------------- +#format = '%(hostname)s.%(domain)s' + +############################# +## Agent Backend Configuration +############################# +[backend:agent:bind9] +#rndc_config_file = /etc/rndc.conf +#rndc_key_file = /etc/rndc.key +#zone_file_path = $state_path/zones +#query_destination = 127.0.0.1 +# +[backend:agent:denominator] +#name = dynect +#config_file = /etc/denominator.conf + +######################## +## Library Configuration +######################## +[oslo_concurrency] +# Path for Oslo Concurrency to store lock files, defaults to the value +# of the state_path setting. +#lock_path = $state_path + +######################## +## Coordination +######################## +[coordination] +{% if coordinator_memcached.url -%} +backend_url = {{ coordinator_memcached.url }} +{%- endif %} + +######################## +## Hook Points +######################## +# Hook Points are enabled when added to the config and there has been +# a package that provides the corresponding named designate.hook_point +# entry point. + +# [hook_point:name_of_hook_point] +# some_param_for_hook = 42 +# Hooks can be disabled in the config +# enabled = False + +# Hook can also be applied to the import path when the hook has not +# been given an explicit name. The name is created from the hook +# target function / method: +# +# name = '%s.%s' % (func.__module__, func.__name__) + +# [hook_point:designate.api.v2.controllers.zones.get_one] + +{% include "parts/section-oslo-middleware" %} diff --git a/src/tests/basic_deployment.py b/src/tests/basic_deployment.py index 19f7aa0..98e843d 100644 --- a/src/tests/basic_deployment.py +++ b/src/tests/basic_deployment.py @@ -116,7 +116,8 @@ class DesignateBasicDeployment(amulet_deployment.OpenStackAmuletDeployment): 'sst-password': 'ChangeMe123', } designate_config = { - 'nameservers': 'ns1-1.example.org. ns2-1.example.org.' + 'nameservers': ' '.join([self.TEST_NS1_RECORD, + self.TEST_NS2_RECORD]) } configs = { 'keystone': keystone_config, @@ -144,11 +145,20 @@ class DesignateBasicDeployment(amulet_deployment.OpenStackAmuletDeployment): self.dns_slave_ip = self.designate_bind_sentry.relation( 'dns-backend', 'designate:dns-backend')['private-address'] - self.designate_svcs = [ - 'designate-agent', 'designate-api', 'designate-central', - 'designate-mdns', 'designate-pool-manager', 'designate-sink', - 'designate-zone-manager', - ] + # bionic_rocky is the "first" rocky version, on Amulet list + # that is why start comparing with this version + if self._get_openstack_release() >= self.bionic_rocky: + self.designate_svcs = [ + 'designate-agent', 'designate-api', 'designate-central', + 'designate-mdns', 'designate-worker', 'designate-sink', + 'designate-producer', + ] + else: + self.designate_svcs = [ + 'designate-agent', 'designate-api', 'designate-central', + 'designate-mdns', 'designate-pool-manager', 'designate-sink', + 'designate-zone-manager', + ] # Authenticate admin with keystone endpoint self.keystone_session, self.keystone = u.get_default_keystone_session(