Update reclass-system ironic support

Add nginx site to serve public Ironic API.
Add keepalived instance for baremetal network.
Add ironic_deploy (Only heartbeat and lookup endpoints allowed)
haproxy site.
Add bmt{0..3} vms on kvm nodes to run ironic deploy services
(ironic-conductor, ironic deploy api, nova-compute with ironic driver)
Add basic definitions for nova/compute_ironic/{cluster|single}.yml

Depends-On: I072db910f6f004aad3393d9f6e64b1330de18687

Change-Id: Ifa9f42532e2fdc06a99a6c78ba961a79d34af110
diff --git a/haproxy/proxy/listen/openstack/ironic_deploy.yml b/haproxy/proxy/listen/openstack/ironic_deploy.yml
new file mode 100644
index 0000000..f5e7a4f
--- /dev/null
+++ b/haproxy/proxy/listen/openstack/ironic_deploy.yml
@@ -0,0 +1,24 @@
+parameters:
+  haproxy:
+    proxy:
+      listen:
+        ironic_deploy:
+          type: general-service
+          service_name: ironic_deploy
+          check: false
+          binds:
+          - address: ${_param:cluster_baremetal_vip_address}
+            port: 6385
+          servers:
+          - name: bmt01
+            host: ${_param:openstack_baremetal_node01_baremetal_address}
+            port: 6385
+            params: check
+          - name: bmt02
+            host: ${_param:openstack_baremetal_node02_baremetal_address}
+            port: 6385
+            params: check
+          - name: bmt03
+            host: ${_param:openstack_baremetal_node03_baremetal_address}
+            port: 6385
+            params: check
diff --git a/ironic/api/cluster.yml b/ironic/api/cluster.yml
index c476c40..c3a7901 100644
--- a/ironic/api/cluster.yml
+++ b/ironic/api/cluster.yml
@@ -6,4 +6,4 @@
       enabled: true
       version: ${_param:ironic_version}
       bind:
-        address: ${_param:cluster_local_address}
+        address: ${_param:cluster_baremetal_local_address}
diff --git a/ironic/conductor/cluster.yml b/ironic/conductor/cluster.yml
index ad4666f..43e870c 100644
--- a/ironic/conductor/cluster.yml
+++ b/ironic/conductor/cluster.yml
@@ -3,4 +3,4 @@
 parameters:
   ironic:
     conductor:
-      api_url: 'http://${_param:cluster_vip_address}'
+      api_url: 'http://${_param:cluster_baremetal_vip_address}'
diff --git a/keepalived/cluster/instance/openstack_baremetal_vip.yml b/keepalived/cluster/instance/openstack_baremetal_vip.yml
new file mode 100644
index 0000000..c3141b6
--- /dev/null
+++ b/keepalived/cluster/instance/openstack_baremetal_vip.yml
@@ -0,0 +1,21 @@
+applications:
+- keepalived
+classes:
+- service.keepalived.support
+parameters:
+  _param:
+    keepalived_openstack_baremetal_vip_address: ${_param:cluster_baremetal_vip_address}
+    keepalived_openstack_baremetal_password: password
+    keepalived_openstack_baremetal_vip_interface: eth1
+    keepalived_openstack_baremetal_vip_virtual_router_id: 132
+    keepalived_openstack_baremetal_vip_priority: ${_param:keepalived_vip_priority}
+  keepalived:
+    cluster:
+      enabled: true
+      instance:
+        openstack_baremetal_vip:
+          address: ${_param:keepalived_openstack_baremetal_vip_address}
+          password: ${_param:keepalived_openstack_baremetal_password}
+          interface: ${_param:keepalived_openstack_baremetal_vip_interface}
+          virtual_router_id: ${_param:keepalived_openstack_baremetal_vip_virtual_router_id}
+          priority: ${_param:keepalived_openstack_baremetal_vip_priority}
diff --git a/nginx/server/site/ironic.yml b/nginx/server/site/ironic.yml
new file mode 100644
index 0000000..d03311c
--- /dev/null
+++ b/nginx/server/site/ironic.yml
@@ -0,0 +1,20 @@
+parameters:
+  _param:
+    nginx_proxy_openstack_api_host: ${_param:cluster_public_host}
+  nginx:
+    server:
+      enabled: true
+      site:
+        nginx_proxy_openstack_api_ironic:
+          enabled: true
+          type: nginx_proxy
+          name: openstack_api_ironic
+          check: false
+          proxy:
+            host: ${_param:ironic_service_host}
+            port: 6385
+            protocol: http
+          host:
+            name: ${_param:nginx_proxy_openstack_api_host}
+            port: 6385
+          ssl: ${_param:nginx_proxy_ssl}
diff --git a/nova/compute_ironic/cluster.yml b/nova/compute_ironic/cluster.yml
new file mode 100644
index 0000000..2526373
--- /dev/null
+++ b/nova/compute_ironic/cluster.yml
@@ -0,0 +1,53 @@
+classes:
+- service.nova.compute.ironic
+parameters:
+  nova:
+    compute:
+      version: ${_param:nova_version}
+      enabled: true
+      virtualization: 'baremetal'
+      pkgs:
+        - nova-compute-ironic
+      database:
+        engine: mysql
+        host: ${_param:openstack_database_address}
+        port: 3306
+        name: nova
+        user: nova
+        password: ${_param:mysql_nova_password}
+      identity:
+        engine: keystone
+        region: ${_param:openstack_region}
+        host: ${_param:cluster_vip_address}
+        port: 35357
+        user: nova
+        password: ${_param:keystone_nova_password}
+        tenant: service
+      message_queue:
+        engine: rabbitmq
+        port: 5672
+        user: openstack
+        password: ${_param:rabbitmq_openstack_password}
+        virtual_host: '/openstack'
+        members:
+          - host: ${_param:openstack_message_queue_node01_address}
+          - host: ${_param:openstack_message_queue_node02_address}
+          - host: ${_param:openstack_message_queue_node03_address}
+      network:
+        engine: neutron
+        region: ${_param:openstack_region}
+        host: ${_param:neutron_service_host}
+        port: 9696
+        user: neutron
+        tenant: service
+        password: ${_param:keystone_neutron_password}
+      ironic:
+        region: ${_param:openstack_region}
+        host: ${_param:ironic_service_host}
+        port: 6385
+        user: ironic
+        tenant: service
+        password: ${_param:keystone_ironic_password}
+        auth_type: password
+        project_domain_name: Default
+        user_domain_name: Default
diff --git a/nova/compute_ironic/single.yml b/nova/compute_ironic/single.yml
new file mode 100644
index 0000000..5c19023
--- /dev/null
+++ b/nova/compute_ironic/single.yml
@@ -0,0 +1,47 @@
+classes:
+- service.nova.compute.ironic
+parameters:
+  nova:
+    compute:
+      version: ${_param:nova_version}
+      enabled: true
+      virtualization: 'baremetal'
+      pkgs:
+        - nova-compute-ironic
+      database:
+        engine: mysql
+        host: ${_param:control_address}
+        port: 3306
+        name: nova
+        user: nova
+        password: ${_param:mysql_nova_password}
+      identity:
+        engine: keystone
+        region: ${_param:openstack_region}
+        host: ${_param:control_address}
+        port: 35357
+        user: nova
+        password: ${_param:keystone_nova_password}
+        tenant: service
+      message_queue:
+        engine: rabbitmq
+        port: 5672
+        user: openstack
+        password: ${_param:rabbitmq_openstack_password}
+        virtual_host: '/openstack'
+        host: ${_param:control_address}
+      network:
+        engine: neutron
+        region: ${_param:openstack_region}
+        host: ${_param:control_address}
+        port: 9696
+        user: neutron
+        tenant: service
+        password: ${_param:keystone_neutron_password}
+      ironic:
+        region: ${_param:openstack_region}
+        host: ${_param:control_address}
+        port: 6385
+        user: ironic
+        tenant: service
+        password: ${_param:keystone_ironic_password}
diff --git a/reclass/storage/system/openstack_baremetal_cluster.yml b/reclass/storage/system/openstack_baremetal_cluster.yml
new file mode 100644
index 0000000..8cab119
--- /dev/null
+++ b/reclass/storage/system/openstack_baremetal_cluster.yml
@@ -0,0 +1,44 @@
+parameters:
+  _param:
+    openstack_baremetal_node01_hostname: bmt01
+    openstack_baremetal_node02_hostname: bmt02
+    openstack_baremetal_node03_hostname: bmt03
+
+    openstack_baremetal_node01_baremetal_address: ${_param:single_address}
+    openstack_baremetal_node02_baremetal_address: ${_param:single_address}
+    openstack_baremetal_node03_baremetal_address: ${_param:single_address}
+  reclass:
+    storage:
+      node:
+        openstack_baremetal_node01:
+          name: ${_param:openstack_baremetal_node01_hostname}
+          domain: ${_param:cluster_domain}
+          classes:
+          - cluster.${_param:cluster_name}.openstack.baremetal
+          params:
+            salt_master_host: ${_param:reclass_config_master}
+            linux_system_codename: ${_param:linux_system_codename}
+            single_address: ${_param:openstack_baremetal_node01_address}
+            baremetal_address: ${_param:openstack_baremetal_node01_baremetal_address}
+        openstack_baremetal_node02:
+          name: ${_param:openstack_baremetal_node02_hostname}
+          domain: ${_param:cluster_domain}
+          classes:
+          - cluster.${_param:cluster_name}.openstack.baremetal
+          params:
+            salt_master_host: ${_param:reclass_config_master}
+            linux_system_codename: ${_param:linux_system_codename}
+            single_address: ${_param:openstack_baremetal_node02_address}
+            baremetal_address: ${_param:openstack_baremetal_node02_baremetal_address}
+        openstack_baremetal_node03:
+          name: ${_param:openstack_baremetal_node03_hostname}
+          domain: ${_param:cluster_domain}
+          classes:
+          - cluster.${_param:cluster_name}.openstack.baremetal
+          params:
+            salt_master_host: ${_param:reclass_config_master}
+            linux_system_codename: ${_param:linux_system_codename}
+            single_address: ${_param:openstack_baremetal_node03_address}
+            baremetal_address: ${_param:openstack_baremetal_node03_baremetal_address}
+
+
diff --git a/reclass/storage/system/openstack_baremetal_single.yml b/reclass/storage/system/openstack_baremetal_single.yml
new file mode 100644
index 0000000..d823157
--- /dev/null
+++ b/reclass/storage/system/openstack_baremetal_single.yml
@@ -0,0 +1,16 @@
+parameters:
+  _param:
+    openstack_baremetal_node01_hostname: bmt01
+  reclass:
+    storage:
+      node:
+        openstack_baremetal_node01:
+          name: ${_param:openstack_baremetal_node01_hostname}
+          domain: ${_param:cluster_domain}
+          classes:
+          - cluster.${_param:cluster_name}.openstack.baremetal
+          params:
+            salt_master_host: ${_param:reclass_config_master}
+            linux_system_codename: ${_param:linux_system_codename}
+            single_address: ${_param:openstack_baremetal_address}
+            baremetal_address: ${_param:openstack_baremetal_node01_baremetal_address}
diff --git a/salt/control/cluster/openstack_baremetal_cluster.yml b/salt/control/cluster/openstack_baremetal_cluster.yml
new file mode 100644
index 0000000..69c3a2b
--- /dev/null
+++ b/salt/control/cluster/openstack_baremetal_cluster.yml
@@ -0,0 +1,26 @@
+parameters:
+  salt:
+    control:
+      size:
+        openstack.baremetal:
+          cpu: 32
+          ram: 65536
+          disk_profile: small
+          net_profile: default
+      cluster:
+        internal:
+          domain: ${_param:cluster_domain}
+          engine: virt
+          node:
+            bmt01:
+              provider: kvm01.${_param:cluster_domain}
+              image: ${_param:salt_control_xenial_image}
+              size: openstack.baremetal
+            bmt02:
+              provider: kvm02.${_param:cluster_domain}
+              image: ${_param:salt_control_xenial_image}
+              size: openstack.baremetal
+            bmt03:
+              provider: kvm03.${_param:cluster_domain}
+              image: ${_param:salt_control_xenial_image}
+              size: openstack.baremetal
diff --git a/salt/control/cluster/openstack_baremetal_single.yml b/salt/control/cluster/openstack_baremetal_single.yml
new file mode 100644
index 0000000..5ff00f5
--- /dev/null
+++ b/salt/control/cluster/openstack_baremetal_single.yml
@@ -0,0 +1,18 @@
+parameters:
+  salt:
+    control:
+      size:
+        openstack.baremetal:
+          cpu: 32
+          ram: 65536
+          disk_profile: small
+          net_profile: default
+      cluster:
+        internal:
+          domain: ${_param:cluster_domain}
+          engine: virt
+          node:
+            bmt01:
+              provider: ${_param:infra_kvm_node01_hostname}.${_param:cluster_domain}
+              image: ${_param:salt_control_xenial_image}
+              size: openstack.baremetal