Add FreeIPA AAA (idp/idm) CI lab [WIP]

Change-Id: Ifdc78334379bf4e639ee3f5d8097b9f57b397135
diff --git a/classes/cluster/aaa_ha_freeipa/aaa/freeipa_client.yml b/classes/cluster/aaa_ha_freeipa/aaa/freeipa_client.yml
new file mode 100644
index 0000000..c9150cb
--- /dev/null
+++ b/classes/cluster/aaa_ha_freeipa/aaa/freeipa_client.yml
@@ -0,0 +1,15 @@
+classes:
+#- system.haproxy.proxy.listen.
+#- system.linux.system.repo.freeipa
+#- system.salt.minion.cert.
+- system.freeipa.client.cluster
+- system.freeipa.client.dns
+- system.freeipa.client.nsupdate
+- system.freeipa.client.keytab.krb5
+- system.freeipa.client.keytab.apache2
+- cluster.aaa_ha_freeipa.aaa
+parameters:
+  _param:
+    keepalived_vip_interface: ${_param:primary_interface}
+    keepalived_vip_virtual_router_id: 99
+    freeipa_client_nsupdate_01_address: ${_param:freeipa_node01_hostname}
diff --git a/classes/cluster/aaa_ha_freeipa/aaa/freeipa_server.yml b/classes/cluster/aaa_ha_freeipa/aaa/freeipa_server.yml
new file mode 100644
index 0000000..5216422
--- /dev/null
+++ b/classes/cluster/aaa_ha_freeipa/aaa/freeipa_server.yml
@@ -0,0 +1,43 @@
+classes:
+# RHEL/Centos based
+#- system.linux.system.repo.saltstack.rhel7
+#- system.haproxy.proxy.listen.
+#- system.salt.minion.cert.
+- system.freeipa.server.cluster
+- cluster.aaa_ha_freeipa.aaa
+parameters:
+  _param:
+    linux_system_codename: centos
+    keepalived_vip_interface: ${_param:primary_interface}
+    keepalived_vip_virtual_router_id: 99
+
+  freeipa:
+    server:
+      realm: ${_param:cluster_domain}
+      domain: ${_param:cluster_domain}
+      servers:
+        - idm01.${_param:cluster_domain}
+        - idm02.${_param:cluster_domain}
+        - idm03.${_param:cluster_domain}
+      admin:
+        password: password
+      ldap:
+        password: password
+      dns:
+        key:
+          axfrkey:
+            # bind9utils
+            # dnssec-keygen -a HMAC-MD5 -b 128 -n HOST rndc-key
+            secret: "xoDeAf49FmBTiJWRJ1zNng=="
+            algorithm: hmac-md5
+            # algorithm: hmac-sha512
+        zone:
+          # Main zones
+          aaa-freeipa.local: ${_param:freeipa_dns_zone}
+
+          # Additional/Internal zones
+          # opencontrail.cz: ${_param:freeipa_dns_zone}
+
+          # Reverse zones
+          # 105.0.10.in-addr.arpa: ${_param:freeipa_dns_zone_reverse}
+
diff --git a/classes/cluster/aaa_ha_freeipa/aaa/init.yml b/classes/cluster/aaa_ha_freeipa/aaa/init.yml
new file mode 100644
index 0000000..9fb2124
--- /dev/null
+++ b/classes/cluster/aaa_ha_freeipa/aaa/init.yml
@@ -0,0 +1,102 @@
+classes:
+- cluster.aaa_ha_freeipa.aaa
+- system.linux.system.single
+- system.openssh.server.team.lab
+- system.openssh.server.team.tcpcloud
+- system.openssh.server.team.mcp_qa
+- system.openssh.server.team.mmo_devops
+parameters:
+  _param:
+    salt_minion_ca_host: ${_param:infra_config_hostname}.${_param:cluster_domain}
+    salt_minion_ca_authority: salt_master_ca
+
+    # freeipa settings
+
+    # addresses and hostnames
+    identity_control_hostname: idm
+    identity_control_address: 172.16.10.240
+    identity_control_node01_hostname: idm01
+    identity_control_node02_hostname: idm02
+    identity_control_node03_hostname: idm03
+    identity_control_node01_address: 172.16.10.241
+    identity_control_node02_address: 172.16.10.242
+    identity_control_node03_address: 172.16.10.243
+    identity_proxy_node01_hostname: prx01
+    identity_proxy_node02_hostname: prx02
+    identity_proxy_node01_address: 172.16.10.244
+    identity_proxy_node02_address: 172.16.10.245
+
+    # cluster meta
+    cluster_vip_address: ${_param:identity_control_address}
+    cluster_local_address: ${_param:single_address}
+    cluster_node01_hostname: ${_param:identity_control_node01_hostname}
+    cluster_node01_address: ${_param:identity_control_node01_address}
+    cluster_node02_hostname: ${_param:identity_control_node02_hostname}
+    cluster_node02_address: ${_param:identity_control_node02_address}
+    cluster_node03_hostname: ${_param:identity_control_node03_hostname}
+    cluster_node03_address: ${_param:identity_control_node03_address}
+
+    freeipa_node01_hostname: ${_param:cluster_node01_address}
+    freeipa_node02_hostname: ${_param:cluster_node02_address}
+    freeipa_node03_hostname: ${_param:cluster_node03_address}
+    freeipa_client_nsupdate_01_address: ${_param:cluster_node01_address}
+
+
+  linux:
+    network:
+      resolv:
+        domain: virtual-aaa-freeipa.local
+        options:
+          - ndots:5
+          - timeout:2
+          - attempts:2
+      host:
+        idm:
+          address: ${_param:identity_control_address}
+          names:
+          - ${_param:identity_control_hostname}
+          - ${_param:identity_control_hostname}.${_param:cluster_domain}
+        idm01:
+          address: ${_param:identity_control_node01_address}
+          names:
+          - ${_param:identity_control_node01_hostname}
+          - ${_param:identity_control_node01_hostname}.${_param:cluster_domain}
+        idm02:
+          address: ${_param:identity_control_node02_address}
+          names:
+          - ${_param:identity_control_node02_hostname}
+          - ${_param:identity_control_node02_hostname}.${_param:cluster_domain}
+        idm03:
+          address: ${_param:identity_control_node03_address}
+          names:
+          - ${_param:identity_control_node03_hostname}
+          - ${_param:identity_control_node03_hostname}.${_param:cluster_domain}
+        cmp01:
+          address: ${_param:identity_compute_node01_address}
+          names:
+          - ${_param:identity_compute_node01_hostname}
+          - ${_param:identity_compute_node01_hostname}.${_param:cluster_domain}
+        cmp02:
+          address: ${_param:identity_compute_node02_address}
+          names:
+          - ${_param:identity_compute_node02_hostname}
+          - ${_param:identity_compute_node02_hostname}.${_param:cluster_domain}
+        prx01:
+          address: ${_param:identity_proxy_node01_address}
+          names:
+          - ${_param:identity_proxy_node01_hostname}
+          - ${_param:identity_proxy_node01_hostname}.${_param:cluster_domain}
+    system:
+      rc:
+        local: |
+          #!/bin/sh -e
+          #
+          # rc.local
+          #
+          ######### This file is managed by Salt! ##########
+          # This script is executed at the end of each multiuser runlevel.
+          # Make sure that the script will "exit 0" on success or any other
+          # value on error.
+          #
+          ip r a 10.254.0.0/16 dev ens3
+          exit 0