Generate inventory from PDF and IDF
This change enables the generation of Ansible inventory by
processing information from PDF & IDF for the nodes provisioned
with bifrost. The inventory generation is moved to the provisioner
instead of the installer as we can disconnect dependency to provisioner
once we generate the ansible inventory for kubespray. This is important
for enabling other provisioners as they have no relation to each other
but they just provision the nodes and record the inventory for them.
The IP which Kubespray operates on is also specified in generated
inventory.
The IP which Kubespray will operate on is specified in generated
inventory. The IP belongs to the interface that is connected to
public network by default. The IP is then extracted from PDF file
using the index of the interface specified under the net_config
section in IDF.
If for some reason a different IP needs to be used, the network
which the interface is connected to must be specified in IDF with
key kubespray_network similar to how pxe_network is specified.
The generated inventory will then contain that IP instead of the
default one.
Change-Id: I3e97013d11d5451f614e2389c95dc7ae2ca5e599
diff --git a/provision.sh b/provision.sh
index 2663f43..3eab2a0 100755
--- a/provision.sh
+++ b/provision.sh
@@ -55,6 +55,14 @@
bifrost-enroll-deploy.yml
echo "-------------------------------------------------------------------------"
+echo "Info: Generate Ansible inventory"
+echo "-------------------------------------------------------------------------"
+cd ${ENGINE_CACHE}/repos/bifrost/playbooks
+ansible-playbook ${ENGINE_ANSIBLE_PARAMS} \
+ -i localhost, \
+ ${BIFROST_ROOT_DIR}/playbooks/generate-inventory.yml
+
+echo "-------------------------------------------------------------------------"
echo "Info: Nodes are provisioned using bifrost!"
echo "-------------------------------------------------------------------------"