group_vars: Refactor provisioner/bifrost
This change refactors bifrost provisioner playbooks and
roles to use group_vars instead of using vars from
engine/engine/var directory.
As bifrost/provision.sh is run on localhost initially,
it uses the newly created inventory file, localhost.ini,
to enable the use of group_vars. In the last command of
bifrost/provision.sh, bifrost_inventory.py is copied to
engine/engine/inventory to access to group_vars so the
the new full inventory file, inventory.ini, to use during
stack installation can be generated.
See the first change in series for the reasoning of
switching to group_vars which has additional information
as well.
Change-Id: I0cc76c2d2e1fb3b192e395c64f5df476b68a9200
diff --git a/playbooks/roles/install-configure-bifrost/tasks/create-bifrost-inventory-entry.yml b/playbooks/roles/install-configure-bifrost/tasks/create-bifrost-inventory-entry.yml
index eb906d1..35ed13d 100644
--- a/playbooks/roles/install-configure-bifrost/tasks/create-bifrost-inventory-entry.yml
+++ b/playbooks/roles/install-configure-bifrost/tasks/create-bifrost-inventory-entry.yml
@@ -16,6 +16,7 @@
#
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
+
- name: Find node in PDF by node name '{{ host.key }}'
set_fact:
hostname: "{{ host.value }}"
@@ -49,3 +50,5 @@
- name: Add node data of '{{ hostname }}' to bifrost inventory
set_fact:
bifrost_inventory: "{{ bifrost_inventory | combine({hostname: node_data}) }}"
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/roles/install-configure-bifrost/tasks/create-bifrost-inventory-file.yml b/playbooks/roles/install-configure-bifrost/tasks/create-bifrost-inventory-file.yml
index 95d8016..fff4302 100644
--- a/playbooks/roles/install-configure-bifrost/tasks/create-bifrost-inventory-file.yml
+++ b/playbooks/roles/install-configure-bifrost/tasks/create-bifrost-inventory-file.yml
@@ -16,6 +16,7 @@
#
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
+
- name: Remove previous bifrost inventory {{ bifrost_inventory_source }}
file:
state: absent
diff --git a/playbooks/roles/install-configure-bifrost/tasks/create-bifrost-playbooks.yml b/playbooks/roles/install-configure-bifrost/tasks/create-bifrost-playbooks.yml
index 21e6e94..8ecfea5 100644
--- a/playbooks/roles/install-configure-bifrost/tasks/create-bifrost-playbooks.yml
+++ b/playbooks/roles/install-configure-bifrost/tasks/create-bifrost-playbooks.yml
@@ -16,6 +16,7 @@
#
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
+
- name: Load distribution variables
include_vars:
file: "{{ distro }}.yml"
diff --git a/playbooks/roles/install-configure-bifrost/tasks/download-image.yml b/playbooks/roles/install-configure-bifrost/tasks/download-image.yml
index c42f4e2..95f8729 100644
--- a/playbooks/roles/install-configure-bifrost/tasks/download-image.yml
+++ b/playbooks/roles/install-configure-bifrost/tasks/download-image.yml
@@ -16,6 +16,7 @@
#
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
+
- name: Set download source and destination for the deployment image
set_fact:
source: "{{ item.source }}"
@@ -42,3 +43,5 @@
sha256sum: "{{ header.x_checksum_sha256 }}"
when: download_image
become: yes
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/roles/install-configure-bifrost/tasks/main.yml b/playbooks/roles/install-configure-bifrost/tasks/main.yml
index 1befc88..8379e6b 100644
--- a/playbooks/roles/install-configure-bifrost/tasks/main.yml
+++ b/playbooks/roles/install-configure-bifrost/tasks/main.yml
@@ -16,6 +16,7 @@
#
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
+
- include_tasks: cleanup-bifrost.yml
- name: Clone bifrost repository and checkout '{{ bifrost_version }}'