rename cluster levels to non-underscore names

Change-Id: Ic9bdafbeb1333699ce424612f8b2e8d8dafb7be2
diff --git a/classes/cluster/ceph-ha/ceph/cfs.yml b/classes/cluster/ceph-ha/ceph/cfs.yml
new file mode 100644
index 0000000..634177a
--- /dev/null
+++ b/classes/cluster/ceph-ha/ceph/cfs.yml
@@ -0,0 +1,4 @@
+classes:
+- system.linux.system.repo.ubuntu
+- system.linux.network.hosts
+- cluster.ceph-ha.infra
diff --git a/classes/cluster/ceph-ha/ceph/common.yml b/classes/cluster/ceph-ha/ceph/common.yml
new file mode 100644
index 0000000..98708f9
--- /dev/null
+++ b/classes/cluster/ceph-ha/ceph/common.yml
@@ -0,0 +1,8 @@
+classes:
+- system.linux.system.repo.ceph
+- cluster.ceph-ha.infra
+parameters:
+  ceph:
+    common:
+      public_network: 10.1.0.0/24
+      cluster_network: 10.16.0.0/24
diff --git a/classes/cluster/ceph-ha/ceph/init.yml b/classes/cluster/ceph-ha/ceph/init.yml
new file mode 100644
index 0000000..6bfb3db
--- /dev/null
+++ b/classes/cluster/ceph-ha/ceph/init.yml
@@ -0,0 +1,72 @@
+parameters:
+  _param:
+    linux_repo_ceph_component: jewel
+    ceph_version: jewel
+    ceph_mon_keepalived_password: tv0jeM4m4neum1s0p3nSt4cK3m
+
+    ceph_mon_hostname: cmn
+    ceph_mon_node01_hostname: cmn01
+    ceph_mon_node02_hostname: cmn02
+    ceph_mon_node03_hostname: cmn03
+    ceph_mon_node01_address: 172.16.10.91
+    ceph_mon_node02_address: 172.16.10.92
+    ceph_mon_node03_address: 172.16.10.93
+
+    ceph_osd_node01_hostname: osd01
+    ceph_osd_node02_hostname: osd02
+    ceph_osd_node03_hostname: osd03
+    ceph_osd_node01_address: 172.16.10.94
+    ceph_osd_node02_address: 172.16.10.95
+    ceph_osd_node03_address: 172.16.10.96
+
+    ceph_cfs_node01_hostname: cfs01
+    ceph_cfs_node01_address: 172.16.10.97
+
+    ceph_cluster_fsid: a619c5fc-c4ed-4f22-9ed2-66cf2feca23d
+    ceph_mon_keyring: AQAnQIhZ6in5KxAAdf467upoRMWFcVg5pbh1yg==
+    ceph_admin_keyring: AQBHPYhZv5mYDBAAvisaSzCTQkC5gywGUp/voA==
+
+  linux:
+    network:
+      host:
+      #   cmn:
+      #     address: ${_param:ceph_mon_address}
+      #     names:
+      #     - ${_param:ceph_mon_hostname}
+      #     - ${_param:ceph_mon_hostname}.${_param:cluster_domain}
+        cmn01:
+          address: ${_param:ceph_mon_node01_address}
+          names:
+          - ${_param:ceph_mon_node01_hostname}
+          - ${_param:ceph_mon_node01_hostname}.${_param:cluster_domain}
+        cmn02:
+          address: ${_param:ceph_mon_node02_address}
+          names:
+          - ${_param:ceph_mon_node02_hostname}
+          - ${_param:ceph_mon_node02_hostname}.${_param:cluster_domain}
+        cmn03:
+          address: ${_param:ceph_mon_node03_address}
+          names:
+          - ${_param:ceph_mon_node03_hostname}
+          - ${_param:ceph_mon_node03_hostname}.${_param:cluster_domain}
+        osd01:
+          address: ${_param:ceph_osd_node01_address}
+          names:
+          - ${_param:ceph_osd_node01_hostname}
+          - ${_param:ceph_osd_node01_hostname}.${_param:cluster_domain}
+        osd02:
+          address: ${_param:ceph_osd_node02_address}
+          names:
+          - ${_param:ceph_osd_node02_hostname}
+          - ${_param:ceph_osd_node02_hostname}.${_param:cluster_domain}
+        osd03:
+          address: ${_param:ceph_osd_node03_address}
+          names:
+          - ${_param:ceph_osd_node03_hostname}
+          - ${_param:ceph_osd_node03_hostname}.${_param:cluster_domain}
+        cfs01:
+          address: ${_param:ceph_cfs_node01_address}
+          names:
+          - ${_param:ceph_cfs_node01_hostname}
+          - ${_param:ceph_cfs_node01_hostname}.${_param:cluster_domain}
+
diff --git a/classes/cluster/ceph-ha/ceph/mon.yml b/classes/cluster/ceph-ha/ceph/mon.yml
new file mode 100644
index 0000000..96fa0b4
--- /dev/null
+++ b/classes/cluster/ceph-ha/ceph/mon.yml
@@ -0,0 +1,4 @@
+classes:
+- system.ceph.mon.cluster
+- cluster.ceph-ha.ceph.common
+- system.linux.network.hosts
diff --git a/classes/cluster/ceph-ha/ceph/mon_init.yml b/classes/cluster/ceph-ha/ceph/mon_init.yml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/classes/cluster/ceph-ha/ceph/mon_init.yml
diff --git a/classes/cluster/ceph-ha/ceph/osd.yml b/classes/cluster/ceph-ha/ceph/osd.yml
new file mode 100644
index 0000000..2d7cb2a
--- /dev/null
+++ b/classes/cluster/ceph-ha/ceph/osd.yml
@@ -0,0 +1,62 @@
+classes:
+- service.ceph.osd.cluster
+- system.linux.network.hosts
+- cluster.ceph-ha.ceph.common
+parameters:
+  ceph:
+    osd:
+      enabled: true
+      copy_admin_key: true
+      journal_type: raw
+      dmcrypt: disable
+      osd_scenario: raw_journal_devices
+      fs_type: xfs
+      disk:
+        '00':
+          rule: hdd
+          dev: /dev/vdb2
+          journal: /dev/vdb1
+          class: bestssd
+          weight: 1.5
+        '01':
+          rule: hdd
+          dev: /dev/vdc2
+          journal: /dev/vdc1
+          class: bestssd
+          weight: 1.5
+        '02':
+          rule: hdd
+          dev: /dev/vdd2
+          journal: /dev/vdd1
+          class: bestssd
+          weight: 1.5
+  linux:
+   storage:
+     disk:
+       disk01:
+         name: /dev/vdb
+         type: gpt
+         partitions:
+         - size: 4000
+           type: xfs
+         - size: 6000
+           type: xfs
+           mkfs: true
+       disk02:
+         name: /dev/vdc
+         type: gpt
+         partitions:
+         - size: 4000
+           type: xfs
+         - size: 6000
+           type: xfs
+           mkfs: true
+       disk03:
+         name: /dev/vdd
+         type: gpt
+         partitions:
+         - size: 4000
+           type: xfs
+         - size: 6000
+           type: xfs
+           mkfs: true
diff --git a/classes/cluster/ceph-ha/ceph/rgw.yml b/classes/cluster/ceph-ha/ceph/rgw.yml
new file mode 100644
index 0000000..fba17bf
--- /dev/null
+++ b/classes/cluster/ceph-ha/ceph/rgw.yml
@@ -0,0 +1,22 @@
+classes:
+- system.linux.system.repo.ceph
+- system.linux.system.repo.ubuntu
+- cluster.ceph-ha.ceph.common
+- cluster.ceph-ha.infra
+parameters:
+  _param:
+    keepalived_ceph_monitor_vip_address: ${_param:ceph_monitor_address}
+    keepalived_ceph_monitor_vip_password: ${_param:ceph_monitor_keepalived_password}
+    keepalived_ceph_monitor_vip_interface: ens3
+    cluster_vip_address: ${_param:ceph_monitor_address}
+    cluster_local_address: ${_param:single_address}
+    cluster_node01_hostname: cmn01
+    cluster_node01_address: ${_param:ceph_monitor_node01_address}
+    cluster_node02_hostname: cmn02
+    cluster_node02_address: ${_param:ceph_monitor_node02_address}
+    cluster_node03_hostname: cmn03
+    cluster_node03_address: ${_param:ceph_monitor_node03_address}
+    ceph_frondend_network: 10.1.0.0/24
+    ceph_backend_network: 10.16.0.0/24
+    nova_storage_keyring: novakeyring
+    cinder_storage_keyring: cinderkeyrinig
\ No newline at end of file
diff --git a/classes/cluster/ceph-ha/infra/config.yml b/classes/cluster/ceph-ha/infra/config.yml
new file mode 100644
index 0000000..cc97968
--- /dev/null
+++ b/classes/cluster/ceph-ha/infra/config.yml
@@ -0,0 +1,108 @@
+classes:
+- system.linux.system.repo.ubuntu
+- system.salt.master.pkg
+  #- system.salt.master.git
+- system.salt.minion.ca.salt_master
+- system.salt.master.api
+- system.reclass.storage.salt
+- system.reclass.storage.system.ceph_mon_cluster
+- cluster.ceph-ha.ceph
+- cluster.ceph-ha.infra
+parameters:
+  _param:
+    salt_master_base_environment: prd
+    reclass_data_repository: "https://github.com/LotharKAtt/ceph-virtual-lab.git"
+#    salt_master_environment_revision: master
+#    salt_master_environment_repository: "https://github.com/salt-formulas"
+    reclass_data_revision: master
+    reclass_config_master: ${_param:infra_config_deploy_address}
+    single_address: ${_param:infra_config_address}
+    linux_system_codename: xenial
+    salt_api_password_hash: "$6$WV0P1shnoDh2gI/Z$22/Bcd7ffMv0jDlFpT63cAU4PiXHz9pjXwngToKwqAsgoeK4HNR3PiKaushjxp3JsQ8hNoJmAC6TxzVqfV8WH/"
+    salt_master_host: 127.0.0.1
+  salt:
+    master:
+      reactor:
+        reclass/minion/classify:
+        - salt://reclass/reactor/node_register.sls
+  reclass:
+    storage:
+      node:
+        infra_storage_rack01:
+          name: osd<<count>>
+          domain: ${_param:cluster_domain}
+          classes:
+          - cluster.${_param:cluster_name}.ceph.osd
+          repeat:
+            count: 3
+            start: 0
+            digits: 1
+            params:
+              ceph_host_id:
+                value: <<count>>
+                start: 1
+              ceph_crush_parent:
+                value: rack<<count>>
+                start: 1
+              # single_address:
+              #   value: ceph_osd_node<<count>>_address
+              #   start: 1
+              #   digits: 2
+              #   interpolate: true
+          params:
+            salt_master_host: ${_param:reclass_config_master}
+            linux_system_codename: xenial
+      class_mapping:
+        common_node:
+          expression: all
+          node_param:
+            single_address:
+              value_template: <<node_control_ip>>
+            linux_system_codename:
+              value_template: <<node_os>>
+            salt_master_host:
+              value_template: <<node_master_ip>>
+        infra_config:
+          expression: <<node_hostname>>__startswith__cfg
+          cluster_param:
+            infra_config_address:
+              value_template: <<node_control_ip>>
+            infra_config_deploy_address:
+              value_template: <<node_deploy_ip>>
+            cluster_domain:
+              value_template: <<node_domain>>
+        ceph_osd_01:
+          expression: <<node_hostname>>__equals__osd0
+          cluster_param:
+            ceph_osd_node01_address:
+              value_template: <<node_control_ip>>
+        ceph_osd_02:
+          expression: <<node_hostname>>__equals__osd1
+          cluster_param:
+            ceph_osd_node02_address:
+              value_template: <<node_control_ip>>
+        ceph_osd_03:
+          expression: <<node_hostname>>__equals__osd2
+          cluster_param:
+            ceph_osd_node03_address:
+              value_template: <<node_control_ip>>
+        ceph_mon_01:
+          expression: <<node_hostname>>__equals__cmn01
+          cluster_param:
+            ceph_mon_node01_address:
+              value_template: <<node_control_ip>>
+        ceph_mon_02:
+          expression: <<node_hostname>>__equals__cmn02
+          cluster_param:
+            ceph_mon_node02_address:
+              value_template: <<node_control_ip>>
+        ceph_mon_03:
+          expression: <<node_hostname>>__equals__cmn03
+          cluster_param:
+            ceph_mon_node03_address:
+              value_template: <<node_control_ip>>
+        ceph_cfs:
+          expression: <<node_hostname>>__startswith__cfs
+          node_class:
+            value_template:
+              - cluster.<<node_cluster>>.ceph.cfs
diff --git a/classes/cluster/ceph-ha/infra/init.yml b/classes/cluster/ceph-ha/infra/init.yml
new file mode 100644
index 0000000..c9183ed
--- /dev/null
+++ b/classes/cluster/ceph-ha/infra/init.yml
@@ -0,0 +1,42 @@
+classes:
+- system.linux.system.single
+- system.linux.system.repo.mcp.extra
+- system.linux.system.repo.mcp.salt #FIXME
+- system.linux.system.repo.saltstack.xenial
+- system.linux.system.repo.ubuntu
+- system.openssh.server.team.members.mlos
+- system.openssh.server.team.tcpcloud
+- cluster.ceph-ha.ceph
+- cluster.overrides
+parameters:
+  _param:
+    salt_version: '2016.3'
+    # infra service addresses
+    infra_config_hostname: cfg01
+#    infra_config_address: 172.16.10.100
+#    infra_config_deploy_address: 192.168.10.100
+
+    cluster_domain: ceph-ha.local
+    cluster_name: ceph_ha
+    apt_mk_version: nightly
+    primary_interface: ens3
+  linux:
+    network:
+      host:
+        cfg01:
+          address: ${_param:infra_config_address}
+          names:
+          - ${_param:infra_config_hostname}
+          - ${_param:infra_config_hostname}.${_param:cluster_domain}
+      interface:
+        primary_interface:
+          enabled: true
+          type: eth
+          proto: dhcp
+          #proto: static
+          #name: ${_param:primary_interface}
+          #address: ${_param:single_address}
+          #netmask: 255.255.255.0
+    system:
+      name: ${_param:infra_config_hostname}
+      domain: ${_param:cluster_domain}