Add ability to deploy Designate with powerdns

designate_backend.yml is added on cluster level to be able to switch Designate
backends between Bind9 and PowerDNS.

Change-Id: Ib8090b2ecd2cee0866e9e612457bcecfad9ae8a1
diff --git a/README b/README
index aac74dd..897e2bb 100644
--- a/README
+++ b/README
@@ -65,6 +65,26 @@
   cd -
 done
 
+# In case Designate should be deployed with PowerDNS backend, change designate_backend.yml:
+cat <<-'EOF' > classes/cluster/designate_backend.yml
+classes:
+- system.designate.server.backend.pdns
+parameters:
+  _param:
+    designate_pool_target_type: pdns4
+    powerdns_webserver_password: gJ6n3gVaYP8eS
+    powerdns_webserver_port: 8081
+    designate_pdns_api_key: VxK9cMlFL5Ae
+    designate_pdns_api_endpoint: "http://${_param:single_address}:${_param:powerdns_webserver_port}"
+    designate_pool_target_options:
+      api_endpoint: ${_param:designate_pdns_api_endpoint}
+      api_token: ${_param:designate_pdns_api_key}
+  powerdns:
+    server:
+      axfr_ips:
+        - ${_param:single_address}
+EOF
+
 # Apply all
 salt-call state.apply # minimum two times or until success
 
@@ -81,7 +101,13 @@
 #salt-call state.apply cinder
 #salt-call state.apply heat
 #salt-call state.apply horizon
+
+#If Powerdns Designate backend:
+#salt-call state.apply powerdns
+
+#If Bind9 Designate backend:
 #salt-call state.apply bind
+
 #salt-call state.apply designate
 # Ironic is not available yet.
 #salt-call state.apply ironic
diff --git a/classes/cluster/designate_backend.yml b/classes/cluster/designate_backend.yml
new file mode 100644
index 0000000..e773c3d
--- /dev/null
+++ b/classes/cluster/designate_backend.yml
@@ -0,0 +1,11 @@
+classes:
+- system.bind.server.single
+- system.designate.server.backend.bind
+parameters:
+  _param:
+    designate_bind9_rndc_key: 4pc+X4PDqb2q+5o72dISm72LM1Ds9X2EYZjqg+nmsS7FhdTwzFFY8l/iEDmHxnyjkA33EQC8H+z0fLLBunoitw==
+    designate_pool_target_type: bind9
+    designate_pool_target_options:
+      rndc_host: ${_param:single_address}
+      rndc_port: 953
+      rndc_key_file: /etc/designate/rndc.key
diff --git a/classes/cluster/virtual-mcp-allinone/openstack/init.yml b/classes/cluster/virtual-mcp-allinone/openstack/init.yml
index 5ad1259..ba3e9e1 100755
--- a/classes/cluster/virtual-mcp-allinone/openstack/init.yml
+++ b/classes/cluster/virtual-mcp-allinone/openstack/init.yml
@@ -30,13 +30,12 @@
 - service.cinder.volume.single
 - system.cinder.volume.backend.lvm
 - system.horizon.server.single
-- system.bind.server.single
 - system.designate.server.single
-- system.designate.server.backend.bind
 #- system.ironic.api.single
 #- system.ironic.conductor.single
 #- system.ironic.tftpd_hpa
 #- system.ironic.apache
+- cluster.designate_backend
 parameters:
   _param:
     openstack_version: ocata
@@ -90,7 +89,6 @@
     horizon_secret_key: workshop
     horizon_identity_encryption: none
     horizon_identity_version: 2
-    designate_bind9_rndc_key: 4pc+X4PDqb2q+5o72dISm72LM1Ds9X2EYZjqg+nmsS7FhdTwzFFY8l/iEDmHxnyjkA33EQC8H+z0fLLBunoitw==
     designate_domain_id: 5186883b-91fb-4891-bd49-e6769234a8fc
     designate_pool_ns_records:
       - hostname: 'ns1.example.org.'
@@ -98,16 +96,12 @@
     designate_pool_nameservers:
       - host: ${_param:single_address}
         port: 53
-    designate_pool_target_type: bind9
     designate_pool_target_masters:
       - host: ${_param:single_address}
         port: 5354
     designate_pool_target_options:
       host: ${_param:single_address}
       port: 53
-      rndc_host: 127.0.0.1
-      rndc_port: 953
-      rndc_key_file: /etc/designate/rndc.key
   neutron:
     server:
       message_queue: