Take infra/swconfig repo into use
This change makes it possible to decouple scenarios themselves
from the engine by adding mechanism to bring the scenario specific
roles from infra/swconfig repo.
The way the mechanism works is
- a scenario is created in infra/swconfig repo, following the directory
structure scenarios/<scenario name>/<installer type>/role/<scenario name>
- the created scenario is declared in engine/engine/var/sdf.yml
- engine copies sdf.yml into engine/.cache/config/sdf.yml
- engine verifies the scenario to be deployed to see if it is supported
by the selected installer and on the distro
- engine clones the scenario from the source repository into engine/.cache/repos,
checks out specified version
- engine bootstrap-scenario.yml playbook uses the scenario role so
scenario specific stuff can be done before the execution of actual install
command
One can use refspec to deploy a scenario that is still open on Gerrit like how
it is done in this change for the scenario k8-calico-nofeature. Once the
corresponding change gets merged, the version to use for the scenario will be
switched to master.
A more detailed guide, listing step by step instructions for scenario development
and testing either locally or on Gerrit will be made available once the implementation
is done..
Change-Id: I8d080ec3891fe27ed2cf595e5d8f81b12fa090d8
diff --git a/playbooks/bootstrap-scenario.yml b/playbooks/bootstrap-scenario.yml
new file mode 100644
index 0000000..87ee04e
--- /dev/null
+++ b/playbooks/bootstrap-scenario.yml
@@ -0,0 +1,31 @@
+---
+# ============LICENSE_START=======================================================
+# Copyright (C) 2019 The Nordix Foundation. All rights reserved.
+# ================================================================================
+# 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.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END=========================================================
+
+- hosts: localhost
+ connection: local
+ gather_facts: true
+ vars_files:
+ - "{{ engine_path }}/engine/var/versions.yml"
+ - "{{ engine_path }}/engine/var/global.yml"
+ - "{{ sdf_file }}"
+
+ roles:
+ - role: "{{ engine_cache }}/repos/swconfig/{{ scenario[deploy_scenario].installers[installer_type].role }}"
+
+# vim: set ts=2 sw=2 expandtab: