xci: Remove intermediate scenarios tasks file 51/56851/4
authorMarkos Chandras <mchandras@suse.de>
Fri, 27 Apr 2018 19:25:30 +0000 (20:25 +0100)
committerMarkos Chandras <mchandras@suse.de>
Mon, 30 Apr 2018 15:09:20 +0000 (16:09 +0100)
Now that the scenario role is recorded as a local fact, we can
include the role directly directly so we don't need the the
intermediate file anymore.

deploy-scenario:os-nosdn-nofeature
installer-type:osa

Change-Id: Ia3c5658826f115538b2a103d987ee8f33d3048b9
Signed-off-by: Markos Chandras <mchandras@suse.de>
xci/installer/kubespray/playbooks/configure-opnfvhost.yml
xci/installer/osa/playbooks/configure-opnfvhost.yml
xci/playbooks/bootstrap-scenarios.yml [deleted file]

index ac8988d..7626b94 100644 (file)
       file:
         path: "{{ remote_xci_path }}/.cache/repos/kubespray/opnfv_inventory/group_vars"
         state: directory
-    - include: "{{ xci_path }}/xci/playbooks/bootstrap-scenarios.yml"
+
+    - name: Reload XCI deployment host facts
+      setup:
+        filter: ansible_local
+        gather_subset: "!all"
+      delegate_to: 127.0.0.1
+
+    - name: Prepare everything to run the {{ deploy_scenario }} role
+      include_role:
+        name: "{{ hostvars['opnfv'].ansible_local.xci.scenarios.role }}"
+
     - name: Install required packages
       package:
         name: "{{ kube_require_packages[ansible_pkg_mgr] }}"
index cca3e42..e277098 100644 (file)
       when:
         - lookup('env','http_proxy') != ""
 
-    - include: "{{ xci_path }}/xci/playbooks/bootstrap-scenarios.yml"
+    - name: Reload XCI deployment host facts
+      setup:
+        filter: ansible_local
+        gather_subset: "!all"
+      delegate_to: 127.0.0.1
+
+    - name: Prepare everything to run the {{ deploy_scenario }} role
+      include_role:
+        name: "{{ hostvars['opnfv'].ansible_local.xci.scenarios.role }}"
 
     - name: bootstrap ansible on opnfv host
       command: "/bin/bash ./scripts/bootstrap-ansible.sh"
diff --git a/xci/playbooks/bootstrap-scenarios.yml b/xci/playbooks/bootstrap-scenarios.yml
deleted file mode 100644 (file)
index d133125..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
----
-#
-# This file is aimed to be used by scenarios to plug into the XCI.
-# Ideally, all they need to do at this point is to include their
-# role using a statement like the following one
-#
-# - name: Include foobar role
-#   include_role:
-#     name: "foobar"
-#   when: deploy_scenario == "foobar"
-
-- name: Prepare everything to run the os-nosdn-nofeature scenario
-  include_role:
-    name: "os-nosdn-nofeature"
-  when: deploy_scenario == 'os-nosdn-nofeature'
-- name: Prepare everything to run the os-odl-nofeature scenario
-  include_role:
-    name: "os-odl-nofeature"
-  when: deploy_scenario == 'os-odl-nofeature'
-- name: Prepare everything to run the os-odl-sfc scenario
-  include_role:
-    name: "os-odl-sfc"
-  when: deploy_scenario == 'os-odl-sfc'
-- name: Prepare everything to run the os-odl-bgpvpn scenario
-  include_role:
-    name: "os-odl-bgpvpn"
-  when: deploy_scenario == 'os-odl-bgpvpn'
-- name: Prepare everything to run the k8-canal-nofeature scenario
-  include_role:
-    name: "k8-canal-nofeature"
-  when: deploy_scenario == 'k8-canal-nofeature'
-- name: Prepare everything to run the k8-canal-nofeature scenario
-  include_role:
-    name: "k8-calico-nofeature"
-  when: deploy_scenario == 'k8-calico-nofeature'
-- name: Prepare everything to run the k8-flannel-nofeature scenario
-  include_role:
-    name: "k8-flannel-nofeature"
-  when: deploy_scenario == 'k8-flannel-nofeature'
-- name: Prepare everything to run the k8-nosdn-nofeature scenario
-  include_role:
-    name: "k8-nosdn-nofeature"
-  when: deploy_scenario == 'k8-nosdn-nofeature'