Add cookied model: dvr-ceph-rgw

Change-Id: I1a72bbeae9d26abd84ffd3df49f34a2d5cb291a3
diff --git a/tcp_tests/templates/cookied-mcp-pike-dvr-ceph/ceph.yaml b/tcp_tests/templates/cookied-mcp-pike-dvr-ceph/ceph.yaml
new file mode 100644
index 0000000..5f2a4ae
--- /dev/null
+++ b/tcp_tests/templates/cookied-mcp-pike-dvr-ceph/ceph.yaml
@@ -0,0 +1,171 @@
+{% from 'cookied-mcp-pike-dvr-ceph/underlay.yaml' import HOSTNAME_CFG01 with context %}
+{% from 'cookied-mcp-pike-dvr-ceph/underlay.yaml' import HOSTNAME_GTW01 with context %}
+{% from 'cookied-mcp-pike-dvr-ceph/underlay.yaml' import LAB_CONFIG_NAME with context %}
+{% from 'cookied-mcp-pike-dvr-ceph/underlay.yaml' import DOMAIN_NAME with context %}
+{% import 'shared-salt.yaml' as SHARED with context %}
+
+{% import 'shared-backup-restore.yaml' as BACKUP with context %}
+
+# Install ceph mons
+- description: Update grains
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@ceph:common' state.sls salt.minion.grains
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 10}
+  skip_fail: false
+
+- description: Generate keyrings
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@ceph:mon:keyring:mon or I@ceph:common:keyring:admin' state.sls ceph.mon
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 10}
+  skip_fail: false
+
+- description: Sync grains on ceph mon nodes
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@ceph:mon' saltutil.sync_grains
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 10}
+  skip_fail: false
+
+- description: Update mine on ceph mons
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@ceph:mon:keyring:mon or I@ceph:common:keyring:admin' mine.update
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 10}
+  skip_fail: false
+
+- description: Install ceph mon
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@ceph:mon' state.sls ceph.mon
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
+- description: Install ceph mgr if defined(needed only for Luminious)
+  cmd: |
+    if salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:mgr' match.pillar 'ceph:mgr' ; then
+      salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:mgr' state.sls ceph.mgr
+    fi
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 2, delay: 5}
+  skip_fail: false
+
+- description: Install ceph osd
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@ceph:osd' state.sls ceph.osd
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
+- description: Sync grains
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@ceph:osd' saltutil.sync_grains
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
+- description: Install ceph osd nodes
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@ceph:osd' state.sls ceph.osd.custom
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: true
+
+- description: Sync grains
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@ceph:osd' saltutil.sync_grains
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
+- description: Update mine on ceph osd
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@ceph:osd' mine.update
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 10}
+  skip_fail: false
+
+- description: Setup pools, keyrings and maybe crush
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@ceph:setup' state.sls ceph.setup
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 10}
+  skip_fail: false
+
+- description: Install ceph clinet
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@ceph:setup' state.sls ceph.setup
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 10}
+  skip_fail: false
+
+- description: Install radosgw if exists
+  cmd: |
+    salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' saltutil.sync_grains;
+    salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' state.sls ceph.radosgw;
+    salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@keystone:client' state.sls keystone.client;
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 2, delay: 5}
+  skip_fail: false
+
+- description: Install ceph clinet
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@ceph:setup' state.sls ceph.setup
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 10}
+  skip_fail: false
+
+{%- for ssh in config.underlay.ssh %}
+  {%- set salt_roles = [] %}
+  {%- for role in ssh['roles'] %}
+    {%- if role in config.salt_deploy.salt_roles %}
+      {%- set _ = salt_roles.append(role) %}
+    {%- endif %}
+  {%- endfor %}
+
+  {%- if salt_roles %}
+- description: Restart salt-minion as workaround of PROD-16970
+  cmd: |
+    service salt-minion restart;  # For case if salt-minion was already installed
+  node_name: {{ ssh['node_name'] }}
+  retry: {count: 1, delay: 1}
+  skip_fail: false
+  {%- endif %}
+{%- endfor %}
+
+- description: Connect ceph to glance
+  cmd: |
+    salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@glance:server' state.sls ceph.common,ceph.setup.keyring,glance;
+    salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@glance:server' service.restart glance-api;
+    salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@glance:server' service.restart glance-registry;
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 2, delay: 5}
+  skip_fail: false
+
+- description: Connect ceph to cinder and nova
+  cmd: |
+    salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@cinder:controller' state.sls ceph.common,ceph.setup.keyring,cinder;
+    salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' state.sls ceph.common,ceph.setup.keyring;
+    salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' saltutil.sync_grains;
+    salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' state.sls nova;
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 2, delay: 5}
+  skip_fail: false
+
+- description: Restart cinder volume
+  cmd: |
+    salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@cinder:controller' service.restart cinder-volume;
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 2, delay: 5}
+  skip_fail: false
+
+- description: Restart nova-compute
+  cmd: |
+    salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@nova:compute' service.restart nova-compute;
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 2, delay: 5}
+  skip_fail: false
+
+{{ BACKUP.MACRO_BACKUP_CEPH() }}
+{{ SHARED.INSTALL_DOCKER_ON_GTW() }}