From 2520a421bc617b9fc38cc66bc0e1d8ccc5afd7ef Mon Sep 17 00:00:00 2001 From: Scott Solkhon Date: Tue, 22 Jan 2019 14:17:54 +0000 Subject: [PATCH] Add support for Infoblox in Designate role This change adds support for Infoblox as a backend for Designate. Change-Id: I7ae038befa88f5a1b3a1187a0e9037ed30f94b17 --- ansible/group_vars/all.yml | 4 +-- ansible/roles/designate/defaults/main.yml | 12 +++++++ ansible/roles/designate/handlers/main.yml | 1 + .../roles/designate/templates/pools.yaml.j2 | 33 +++++++++++++++++++ 4 files changed, 48 insertions(+), 2 deletions(-) diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index c808fd0eda..b298fa8309 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -199,7 +199,7 @@ collectd_udp_port: "25826" designate_api_port: "9001" designate_bind_port: "53" -designate_mdns_port: "5354" +designate_mdns_port: "{{ '53' if designate_backend == 'infoblox' else '5354' }}" designate_rndc_port: "953" elasticsearch_port: "9200" @@ -742,7 +742,7 @@ cloudkitty_collector_backend: "gnocchi" ####################### # Designate options ####################### -# Valid options are [ bind9 ] +# Valid options are [ bind9, infoblox ] designate_backend: "bind9" designate_ns_record: "sample.openstack.org" designate_backend_external: "no" diff --git a/ansible/roles/designate/defaults/main.yml b/ansible/roles/designate/defaults/main.yml index 2e1646c966..435ba663f5 100644 --- a/ansible/roles/designate/defaults/main.yml +++ b/ansible/roles/designate/defaults/main.yml @@ -175,3 +175,15 @@ designate_dnssec_validation: "yes" designate_recursion: "no" ## Example for designate_forwarders_addresses: "10.199.200.1; 10.199.100.1" designate_forwarders_addresses: "" + +#################### +# Infoblox +#################### +designate_backend_infoblox_nameservers: "" +designate_infoblox_host: "" +designate_infoblox_wapi_url: "" +designate_infoblox_ssl_verify: "true" +designate_infoblox_auth_username: "" +designate_infoblox_auth_password: "" +designate_infoblox_multi_tenant: "false" +designate_infoblox_ns_group: "" diff --git a/ansible/roles/designate/handlers/main.yml b/ansible/roles/designate/handlers/main.yml index eb9064fa09..5f6207f96a 100644 --- a/ansible/roles/designate/handlers/main.yml +++ b/ansible/roles/designate/handlers/main.yml @@ -149,6 +149,7 @@ or designate_rndc_key_file.changed | bool or policy_overwriting.changed | bool or designate_worker_container.changed | bool + or designate_pool.changed | bool - name: Restart designate-sink container vars: diff --git a/ansible/roles/designate/templates/pools.yaml.j2 b/ansible/roles/designate/templates/pools.yaml.j2 index 02a1291049..eddbba77c7 100644 --- a/ansible/roles/designate/templates/pools.yaml.j2 +++ b/ansible/roles/designate/templates/pools.yaml.j2 @@ -52,4 +52,37 @@ rndc_key_file: /etc/designate/rndc.key {% endfor %} {% endif %} +{% elif designate_backend == 'infoblox' %} +- name: infoblox + id: {{ designate_pool_id }} + description: Default Infoblox Pool + attributes: + internal: true + ns_records: + - hostname: {{ designate_ns_record }}. + priority: 1 + nameservers: +{% for host in designate_backend_infoblox_nameservers.replace(" ", "").split(',') %} + - host: {{ host }} + port: {{ designate_bind_port }} +{% endfor %} + targets: + - type: infoblox + description: Default Infoblox Pool + masters: +{% for mdns_host in groups['designate-mdns'] %} + - host: {{ hostvars[mdns_host]['ansible_' + hostvars[mdns_host]['dns_interface']]['ipv4']['address'] }} + port: {{ designate_mdns_port }} +{% endfor %} + options: + host: {{ designate_infoblox_host }} + port: 53 + http_pool_maxsize: 100 + http_pool_connections: 100 + wapi_url: {{ designate_infoblox_wapi_url }} + sslverify: {{ designate_infoblox_ssl_verify }} + username: {{ designate_infoblox_auth_username }} + password: {{ designate_infoblox_auth_password }} + multi_tenant: {{ designate_infoblox_multi_tenant }} + ns_group: {{ designate_infoblox_ns_group }} {% endif %}