[CORD-1556] Generating inital data and mounting on xos-core
Change-Id: Icdd1a596083f385b7af831aef0ce3f23ef732542
diff --git a/roles/cord-profile/templates/initial_data.yaml.j2 b/roles/cord-profile/templates/initial_data.yaml.j2
new file mode 100644
index 0000000..4433c2b
--- /dev/null
+++ b/roles/cord-profile/templates/initial_data.yaml.j2
@@ -0,0 +1,52 @@
+{#
+Copyright 2017-present Open Networking Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+#}
+
+# Site
+- model: core.Site
+ fields:
+ name: {{ site_name }}
+ site_url: http://{{ site_name }}.opencloud.us/
+ hosts_nodes: true
+
+# User
+- model: core.User
+ fields:
+ email: {{ xos_admin_user }}
+ password: {{ xos_admin_pass }}
+ firstname: {{ xos_admin_first }}
+ lastname: {{ xos_admin_last }}
+ is_admin: True
+ relations:
+ site:
+ fields:
+ name: {{ site_name }}
+ model: core.Site
+
+# All other users
+{% for user in xos_users %}
+- model: core.User
+ fields:
+ email: {{ user.email }}
+ password: {{ user.password }}
+ firstname: {{ user.first | default(user.email) }}
+ lastname: {{ user.last | default("unknown") }}
+ is_admin: {{ user.admin | default("false") }}
+ relations:
+ site:
+ fields:
+ name: {{ site_name }}
+ model: core.Site
+{% endfor %}
\ No newline at end of file