181 lines
6.3 KiB
YAML
181 lines
6.3 KiB
YAML
heat_template_version: wallaby
|
|
|
|
description: >
|
|
OpenStack containerized bind9 for designate
|
|
|
|
parameters:
|
|
ContainerDesignateBackendBIND9Image:
|
|
description: image
|
|
type: string
|
|
tags:
|
|
- role_specific
|
|
ContainerDesignateConfigImage:
|
|
description: The container image to use for the designate config_volume
|
|
type: string
|
|
tags:
|
|
- role_specific
|
|
EndpointMap:
|
|
default: {}
|
|
description: Mapping of service endpoint -> protocol. Typically set
|
|
via parameter_defaults in the resource registry.
|
|
type: json
|
|
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. Use
|
|
parameter_merge_strategies to merge it with the defaults.
|
|
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
|
|
MonitoringSubscriptionDesignateBind:
|
|
default: 'overcloud-designate-bind'
|
|
type: string
|
|
DesignateRndcKey:
|
|
description: The rndc key secret for communication with BIND.
|
|
type: string
|
|
hidden: true
|
|
DesignateBindQueryLogging:
|
|
description: Set to true to enable logging of queries on BIND.
|
|
type: boolean
|
|
default: false
|
|
|
|
resources:
|
|
|
|
ContainersCommon:
|
|
type: ../containers-common.yaml
|
|
|
|
DesignateBase:
|
|
type: ./designate-base.yaml
|
|
properties:
|
|
EndpointMap: {get_param: EndpointMap}
|
|
ServiceData: {get_param: ServiceData}
|
|
ServiceNetMap: {get_param: ServiceNetMap}
|
|
RoleName: {get_param: RoleName}
|
|
RoleParameters: {get_param: RoleParameters}
|
|
|
|
RoleParametersValue:
|
|
type: OS::Heat::Value
|
|
properties:
|
|
type: json
|
|
value:
|
|
map_replace:
|
|
- map_replace:
|
|
- ContainerDesignateBackendBIND9Image: ContainerDesignateBackendBIND9Image
|
|
ContainerDesignateConfigImage: ContainerDesignateConfigImage
|
|
- values: {get_param: [RoleParameters]}
|
|
- values:
|
|
ContainerDesignateBackendBIND9Image: {get_param: ContainerDesignateBackendBIND9Image}
|
|
ContainerDesignateConfigImage: {get_param: ContainerDesignateConfigImage}
|
|
|
|
outputs:
|
|
role_data:
|
|
description: Role data for the Designate Bind instance.
|
|
value:
|
|
service_name: designate_bind
|
|
firewall_rules:
|
|
'140 designate_worker udp':
|
|
proto: 'udp'
|
|
dport:
|
|
- 53
|
|
- 953
|
|
'141 designate_worker tcp':
|
|
proto: 'tcp'
|
|
dport:
|
|
- 53
|
|
- 953
|
|
monitoring_subscription: {get_param: MonitoringSubscriptionDesignateBind}
|
|
config_settings:
|
|
map_merge:
|
|
- get_attr: [DesignateBase, role_data, config_settings]
|
|
- designate::backend::bind9::configure_bind: false
|
|
puppet_config:
|
|
config_volume: designate
|
|
puppet_tags: designate_config
|
|
step_config: {get_attr: [DesignateBase, role_data, step_config]}
|
|
config_image: {get_attr: [RoleParametersValue, value, ContainerDesignateConfigImage]}
|
|
kolla_config:
|
|
/var/lib/kolla/config_files/designate_backend_bind9.json:
|
|
command: /usr/sbin/named -u named -c /etc/named.conf -f
|
|
config_files:
|
|
- source: "/var/lib/kolla/config_files/src/*"
|
|
dest: "/"
|
|
merge: true
|
|
preserve_properties: true
|
|
- source: "/var/named/*"
|
|
dest: "/var/named-persistent/"
|
|
merge: true
|
|
preserve_properties: true
|
|
permissions:
|
|
- path: /var/log/designate
|
|
owner: designate:designate
|
|
recurse: true
|
|
- path: /var/log/bind
|
|
owner: root:named
|
|
recurse: true
|
|
perm: '0775'
|
|
- path: /var/named-persistent
|
|
owner: root:named
|
|
perm: '0770'
|
|
- path: /etc/rndc.key
|
|
owner: root:named
|
|
perm: '0640'
|
|
deploy_steps_tasks:
|
|
- name: generate rndc key configuration files
|
|
when: step|int == 4
|
|
import_role:
|
|
name: designate_rndc_config
|
|
vars:
|
|
designate_rndc_key: {get_param: DesignateRndcKey}
|
|
designate_rndc_key_file_path: /var/lib/config-data/ansible-generated/designate/etc/
|
|
- name: generate bind configuration
|
|
when: step|int == 4
|
|
import_role:
|
|
name: designate_bind_config
|
|
vars:
|
|
designate_bind_enable_query_logging: {get_param: DesignateBindQueryLogging}
|
|
rndc_allowed_addresses:
|
|
get_param:
|
|
- ServiceData
|
|
- net_cidr_map
|
|
- {get_param: [ServiceNetMap, DesignateApiNetwork]}
|
|
docker_config:
|
|
step_4:
|
|
designate_backend_bind9:
|
|
image: {get_attr: [RoleParametersValue, value, ContainerDesignateBackendBIND9Image]}
|
|
net: host
|
|
privileged: true
|
|
stop_grace_period: 300
|
|
restart: always
|
|
volumes:
|
|
list_concat:
|
|
- {get_attr: [ContainersCommon, volumes]}
|
|
-
|
|
- /run:/run
|
|
- /var/lib/kolla/config_files/designate_backend_bind9.json:/var/lib/kolla/config_files/config.json:ro
|
|
- /var/lib/config-data/ansible-generated/designate:/var/lib/kolla/config_files/src:ro
|
|
- /var/log/containers/designate:/var/log/designate:z
|
|
- /var/log/containers/designate-bind:/var/log/bind:z
|
|
- /var/lib/designate/named-persistent:/var/named-persistent:z
|
|
environment:
|
|
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
|
|
host_prep_tasks:
|
|
- name: create persistent named directories
|
|
file:
|
|
path: "{{ item.path }}"
|
|
state: directory
|
|
setype: "{{ item.setype }}"
|
|
mode: "{{ item.mode }}"
|
|
with_items:
|
|
- { 'path': /var/lib/designate/named-persistent, 'setype': container_file_t, 'mode': '0750' }
|
|
- { 'path': /var/log/containers/designate-bind, 'setype': container_file_t, 'mode': '0750' }
|