made opencloud profile more configurable from platform-install, ordering in common tosca

Change-Id: I40fe533b139f181164ba3eedc30a341eba3af208
diff --git a/common/tosca/fixtures.yaml b/common/tosca/fixtures.yaml
index fcb58e0..9ac1a93 100644
--- a/common/tosca/fixtures.yaml
+++ b/common/tosca/fixtures.yaml
@@ -75,6 +75,9 @@
     m1.large:
       type: tosca.nodes.Flavor
 
+    m1.xlarge:
+      type: tosca.nodes.Flavor
+
 # -----------------------------------------------------------------------------
 # Dashboard Views
 # -----------------------------------------------------------------------------
diff --git a/common/tosca/mydeployment.yaml b/common/tosca/mydeployment.yaml
index 1205723..2adfdff 100644
--- a/common/tosca/mydeployment.yaml
+++ b/common/tosca/mydeployment.yaml
@@ -7,13 +7,14 @@
 
 topology_template:
   node_templates:
-    m1.large:
+
+    m1.small:
       type: tosca.nodes.Flavor
 
     m1.medium:
       type: tosca.nodes.Flavor
 
-    m1.small:
+    m1.large:
       type: tosca.nodes.Flavor
 
     m1.xlarge:
@@ -22,17 +23,17 @@
     MyDeployment:
       type: tosca.nodes.Deployment
       requirements:
-          - m1.xlarge:
-             node: m1.large
-             relationship: tosca.relationships.SupportsFlavor
-          - m1.large:
-             node: m1.large
+          - m1.small:
+             node: m1.small
              relationship: tosca.relationships.SupportsFlavor
           - m1.medium:
              node: m1.medium
              relationship: tosca.relationships.SupportsFlavor
-          - m1.small:
-             node: m1.small
+          - m1.large:
+             node: m1.large
+             relationship: tosca.relationships.SupportsFlavor
+          - m1.xlarge:
+             node: m1.xlarge
              relationship: tosca.relationships.SupportsFlavor
 
     mysite:
diff --git a/opencloud/Makefile b/opencloud/Makefile
index fd089e6..98d5f0e 100644
--- a/opencloud/Makefile
+++ b/opencloud/Makefile
@@ -11,7 +11,7 @@
 # Include common functions
 include $(COMMON_DIR)/Makefile
 
-xos: prereqs config_dirs xos_download opencloud_services bootstrap onboarding podconfig
+xos: prereqs config_dirs xos_download opencloud_services oc_bootstrap onboarding
 
 opencloud_services: $(SERVICE_DIR) \
 	$(SERVICE_DIR)/onos-service \
@@ -19,6 +19,19 @@
 	$(SERVICE_DIR)/vrouter \
 	$(SERVICE_DIR)/vtn
 
+opencloud_bootstrap: deployment.yaml
+	@echo "[OC BOOTSTRAP]"
+	@echo "XOS Image Build Date: `sudo docker inspect -f '{{ .Created }}' xosproject/xos`"
+	@echo "XOS Image Commit Hash: `sudo docker inspect -f '{{ .Config.Labels.XOS_GIT_COMMIT_HASH }}' xosproject/xos`"
+	@echo "XOS Image Commit Date: `sudo docker inspect -f '{{ .Config.Labels.XOS_GIT_COMMIT_DATE }}' xosproject/xos`"
+	sudo rm -f $(DOCKER_COMPOSE_YML)
+	sudo CONFIG_DIR=$(CONFIG_DIR) docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) up -d
+	bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_BOOTSTRAP_PORT)
+	sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < $(COMMON_DIR)/tosca/fixtures.yaml
+	sudo docker-compose -p $(BOOTSTRAP_PROJECT) -f $(BOOTSTRAP_YML) run xos_bootstrap_ui python /opt/xos/tosca/run.py none - < deployment.yaml
+	bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_BOOTSTRAP_PORT)
+	$(RUN_TOSCA_BOOTSTRAP) $(CONFIG_DIR)/xos.yaml
+
 onboarding: synchronizers.yaml id_rsa id_rsa.pub
 	@echo "[ONBOARDING]"
 	bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
@@ -37,12 +50,6 @@
 	bash $(COMMON_DIR)/wait_for_onboarding_ready.sh $(XOS_BOOTSTRAP_PORT) xos
 	bash $(COMMON_DIR)/wait_for_xos_port.sh $(XOS_UI_PORT)
 
-podconfig: nodes.yaml images.yaml
-	@echo "[PODCONFIG]"
-	$(RUN_TOSCA) $(COMMON_DIR)/tosca/setup.yaml
-	$(RUN_TOSCA) nodes.yaml
-	$(RUN_TOSCA) images.yaml
-
 opencloud: opencloud.yaml
 	@echo "[OPENCLOUD]"
 	$(RUN_TOSCA) opencloud.yaml
diff --git a/opencloud/docker-compose-bootstrap.yml b/opencloud/docker-compose-bootstrap.yml
index ee9437c..461239a 100644
--- a/opencloud/docker-compose-bootstrap.yml
+++ b/opencloud/docker-compose-bootstrap.yml
@@ -42,6 +42,7 @@
         - ../common/xos_common_config:/opt/xos/xos_configuration/xos_common_config:ro
         - ./files/xos_vtn_config:/opt/xos/xos_configuration/xos_vtn_config:ro
         - ../../xos_services:/opt/xos_services
+        - ./admin-openrc.sh:/root/setup/admin-openrc.sh
     log_driver: "json-file"
     log_opt:
             max-size: "100k"
diff --git a/opencloud/files/openstack_synchronizer_config b/opencloud/files/openstack_synchronizer_config
new file mode 100644
index 0000000..74d68e3
--- /dev/null
+++ b/opencloud/files/openstack_synchronizer_config
@@ -0,0 +1,31 @@
+[db]
+name=xos
+user=postgres
+password=password
+host=localhost
+port=5432
+
+[api]
+nova_enabled=True
+
+[nova]
+ca_ssl_cert=/etc/ssl/certs/ca-certificates.crt
+
+[observer]
+name=openstack
+dependency_graph=/opt/xos/model-deps
+steps_dir=/opt/xos/synchronizers/openstack/steps
+sys_dir=/opt/xos/synchronizers/openstack/sys
+model_policies_dir=/opt/xos/synchronizers/openstack/model_policies
+logfile=/var/log/xos_backend.log
+save_ansible_output=True
+backoff_disabled=True
+pretend=False
+images_directory=/opt/xos/images
+
+[feefie]
+client_id='vicci_dev_central'
+user_id='pl'
+
+[networking]
+use_vtn=True