ceph ha cluster

Change-Id: I695e231321c34798af4b3ecc94c9a10e6c7df0b5
diff --git a/classes/cluster/ceph_ha/ceph/cfs.yml b/classes/cluster/ceph_ha/ceph/cfs.yml
new file mode 100644
index 0000000..a47023e
--- /dev/null
+++ b/classes/cluster/ceph_ha/ceph/cfs.yml
@@ -0,0 +1,3 @@
+classes:
+- system.linux.system.repo.ubuntu
+- cluster.ceph_ha.infra
diff --git a/classes/cluster/ceph_ha/ceph/init.yml b/classes/cluster/ceph_ha/ceph/init.yml
new file mode 100644
index 0000000..be651ce
--- /dev/null
+++ b/classes/cluster/ceph_ha/ceph/init.yml
@@ -0,0 +1,72 @@
+parameters:
+  _param:
+    linux_repo_ceph_component: kraken
+    ceph_monitor_keepalived_password: tv0jeM4m4neum1s0p3nSt4cK3m
+
+
+    ceph_monitor_hostname: cmn
+    ceph_monitor_node01_hostname: cmn01
+    ceph_monitor_node02_hostname: cmn02
+    ceph_monitor_node03_hostname: cmn03
+
+    ceph_monitor_address: 172.16.10.89
+    ceph_monitor_node01_address: ${_param:ceph_monitor_01_address}
+    ceph_monitor_node02_address: ${_param:ceph_monitor_02_address}
+    ceph_monitor_node03_address: ${_param:ceph_monitor_03_address}
+
+
+
+    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
+  linux:
+    network:
+      host:
+        cmn:
+          address: ${_param:ceph_monitor_address}
+          names:
+          - ${_param:ceph_monitor_hostname}
+          - ${_param:ceph_monitor_hostname}.${_param:cluster_domain}
+        cmn01:
+          address: ${_param:ceph_monitor_node01_address}
+          names:
+          - ${_param:ceph_monitor_node01_hostname}
+          - ${_param:ceph_monitor_node01_hostname}.${_param:cluster_domain}
+        cmn02:
+          address: ${_param:ceph_monitor_node02_address}
+          names:
+          - ${_param:ceph_monitor_node02_hostname}
+          - ${_param:ceph_monitor_node02_hostname}.${_param:cluster_domain}
+        cmn03:
+          address: ${_param:ceph_monitor_node03_address}
+          names:
+          - ${_param:ceph_monitor_node03_hostname}
+          - ${_param:ceph_monitor_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/monitor.yml b/classes/cluster/ceph_ha/ceph/monitor.yml
new file mode 100644
index 0000000..14b843d
--- /dev/null
+++ b/classes/cluster/ceph_ha/ceph/monitor.yml
@@ -0,0 +1,59 @@
+classes:
+- system.linux.system.repo.ubuntu
+- system.linux.system.repo.ceph
+- service.keepalived.cluster.single
+#- service.ceph.monitor.cluster
+- 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
+  ceph:
+    common:
+      version: kraken
+      fsid: a619c5fc-c4ed-4f22-9ed2-66cf2feca23d
+      public_network: 10.1.0.0/24
+      cluster_network: 10.16.0.0/24
+      members:
+        - name: ${_param:cluster_node01_hostname}
+          host: ${_param:cluster_node01_address}
+        - name: ${_param:cluster_node02_hostname}
+          host: ${_param:cluster_node02_address}
+        - name: ${_param:cluster_node03_hostname}
+          host: ${_param:cluster_node03_address}
+      keyring:
+        admin:
+          key: AQBHPYhZv5mYDBAAvisaSzCTQkC5gywGUp/voA==
+          caps:
+            mds: "allow *"
+            mgr: "allow *"
+            mon: "allow *"
+            osd: "allow *"
+
+    monitor:
+      enabled: true
+      keyring:
+        mon:
+          key: AQAnQIhZ6in5KxAAdf467upoRMWFcVg5pbh1yg==
+          caps:
+            mon: "allow *"
+        admin:
+          key: AQBHPYhZv5mYDBAAvisaSzCTQkC5gywGUp/voA==
+          caps:
+            mds: "allow *"
+            mgr: "allow *"
+            mon: "allow *"
+            osd: "allow *"
diff --git a/classes/cluster/ceph_ha/ceph/osd.yml b/classes/cluster/ceph_ha/ceph/osd.yml
new file mode 100644
index 0000000..8aed169
--- /dev/null
+++ b/classes/cluster/ceph_ha/ceph/osd.yml
@@ -0,0 +1,33 @@
+classes:
+- system.linux.system.repo.ceph
+- system.linux.system.repo.ubuntu
+- 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
+  ceph:
+    osd:
+      copy_admin_key: true
+      journal_type: raw
+      disks:
+        - /dev/sda:
+          journal: yes
+          journal_device: /dev/sdd
+        - /dev/sdb:
+          journal_device: /dev/sde
+      dmcrypt: disable
+      osd_scenario: raw_journal_devices
diff --git a/classes/cluster/ceph_ha/infra/config.yml b/classes/cluster/ceph_ha/infra/config.yml
new file mode 100644
index 0000000..8d76636
--- /dev/null
+++ b/classes/cluster/ceph_ha/infra/config.yml
@@ -0,0 +1,86 @@
+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_monitor_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:
+      environment:
+        prd:
+          formula:
+            ceph:
+              source: git
+              address: 'https://github.com/LotharKAtt/salt-formula-ceph.git'
+              revision: master
+        dev:
+          formula:
+            ceph:
+              source: git
+              address: 'https://github.com/LotharKAtt/salt-formula-ceph.git'
+              revision: master
+      reactor:
+        reclass/minion/classify:
+        - salt://reclass/reactor/node_register.sls
+  reclass:
+    storage:
+      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:
+          expression: <<node_hostname>>__startswith__osd
+          node_class:
+            value_template:
+              - cluster.<<node_cluster>>.ceph.osd
+        ceph_monitor_01:
+          expression: <<node_hostname>>__equals__cmn01
+          cluster_param:
+            ceph_monitor_01_address:
+              value_template: <<node_control_ip>>
+        ceph_monitor_02:
+          expression: <<node_hostname>>__equals__cmn02
+          cluster_param:
+            ceph_monitor_02_address:
+              value_template: <<node_control_ip>>
+        ceph_monitor_03:
+          expression: <<node_hostname>>__equals__cmn03
+          cluster_param:
+            ceph_monitor_03_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..01a74ea
--- /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}