Add cmps and storage network settings for SI MOCK lab

- if the network with CONTROL_NETWORK_CIDR is not
  configured at the start of the script, CONTROL_IP_ADDRESS
  got the 'src' instead of IP address because:

    $ ip route get ${CONTROL_NETWORK_CIDR%/*}
    172.16.51.0 via 172.16.50.1 dev enp8s0f0 src 172.16.50.21 uid 0

  Ensure that the CONTROL_IP_ADDRESS will be empty in case
  if control network is not configured yet (no 'via' in the route).

  Fail in case

- split the function "prepare_metadata_files" on two functions:
  "prepare_metadata_files" and "collect_ceph_metadata"

- "prepare_metadata_files" function should be executed
  at the very beginning to prepare configs before
  any other service is set up

- "network_config" function must be executed right after
  "prepare_metadata_files" to initialize the correct
  CONTROL_IP_ADDRESS in case if this address is not from
  the PXE interface and is not available until network
  configuration is completed

- add "disable-rp-filter" function to allow different
  networks on the same node

https: //mirantis.jira.com/browse/PRODX-2630
Change-Id: I9f28f8f4b60efce64eecf7eb70cf75746892424e
diff --git a/de/heat-templates/top.yaml b/de/heat-templates/top.yaml
index 5c3b390..0ce2437 100644
--- a/de/heat-templates/top.yaml
+++ b/de/heat-templates/top.yaml
@@ -87,6 +87,12 @@
   storage_backend_interface:
     type: string
     default: 'ens6'
+  ucp_metadata:
+    type: json
+    default: {"role":"ucp"}
+  master_metadata:
+    type: json
+    default: {"role":"master"}
   worker_metadata:
     type: json
     default: {}
@@ -191,7 +197,7 @@
      - storage_network
     type: MCP2::SrvInstances
     properties:
-      metadata: {"role":"ucp"}
+      metadata: { get_param: ucp_metadata}
       docker_ee_url: { get_param: docker_ee_url }
       docker_ee_release: { get_param: docker_ee_release }
       node_type: "ucp"
@@ -218,7 +224,7 @@
       resource_def:
         type: MCP2::SrvInstances
         properties:
-          metadata: {"role":"master"}
+          metadata: { get_param: master_metadata}
           node_type: "master"
           key_name: { get_param: "OS::stack_name" }
           image: { get_param: image }
@@ -398,14 +404,14 @@
           storage_backend_network_cidr: { get_param: storage_backend_network_cidr }
           hardware_metadata: { get_param: hardware_metadata}
 
-  spares:  # spares for workers
+  spares:  # spares for osds/cmps
     type: OS::Heat::ResourceGroup
     depends_on:
      - ucp
     properties:
       count: { get_param: spare_size }
       resource_def:
-        type: MCP2::SrvInstancesCeph
+        type: MCP2::SrvInstancesCephOSD
         properties:
           metadata: { get_param: spare_metadata }
           node_type: "spare"
@@ -428,6 +434,10 @@
           storage_frontend_network: { get_attr: [storage_network, storage_frontend_network_id] }
           storage_frontend_subnet_id: { get_attr: [storage_network, storage_frontend_subnet_id] }
           storage_frontend_network_cidr: { get_param: storage_frontend_network_cidr }
+          storage_backend_interface: { get_param: storage_backend_interface }
+          storage_backend_network: { get_attr: [storage_network, storage_backend_network_id] }
+          storage_backend_subnet_id: { get_attr: [storage_network, storage_backend_subnet_id] }
+          storage_backend_network_cidr: { get_param: storage_backend_network_cidr }
           hardware_metadata: { get_param: hardware_metadata}
 
   ntws: