diff options
author | 2018-05-15 10:56:23 +0100 | |
---|---|---|
committer | 2018-05-16 14:46:00 +0100 | |
commit | 0ed80c59846e9e1b23d26869f05f109dac7495c5 (patch) | |
tree | ff57633e68f9a557bd69a4b2ba3327e10e91635f /xci/installer/kubespray/deploy.sh | |
parent | 8dc9f3a0d2c4db3bd9720966043dda0d2d4431bb (diff) |
xci: kubespray: Switch kubespray to dynamic inventory
The kubespray installer contains one inventory per flavor. We can get
rid of these files and use the dynamic inventory similar to OSA.
Moreover, we extend the dynamic inventory to read additional group
variables per flavor if necessary. This way we can still pass additional
information to inventory on per-flavor basis. This also fixes a typo
in the 'IDF' file. We also need to bump Ansible for kubespray since the
version we were using is having troubles with dynamic inventories.
Change-Id: Ic58101555f81aec5fee3c193608440aa89bbe445
Signed-off-by: Markos Chandras <mchandras@suse.de>
Diffstat (limited to 'xci/installer/kubespray/deploy.sh')
-rwxr-xr-x | xci/installer/kubespray/deploy.sh | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/xci/installer/kubespray/deploy.sh b/xci/installer/kubespray/deploy.sh index 02a9d430..bcd7dc1d 100755 --- a/xci/installer/kubespray/deploy.sh +++ b/xci/installer/kubespray/deploy.sh @@ -28,8 +28,7 @@ echo "Info: Configuring localhost for kubespray" echo "-----------------------------------------------------------------------" cd $XCI_PLAYBOOKS ansible-playbook ${XCI_ANSIBLE_PARAMS} -e XCI_PATH="${XCI_PATH}" \ - -i ${XCI_FLAVOR_ANSIBLE_FILE_PATH}/inventory/inventory.cfg \ - configure-localhost.yml + -i dynamic_inventory.py configure-localhost.yml echo "-----------------------------------------------------------------------" echo "Info: Configured localhost for kubespray" @@ -46,9 +45,8 @@ echo "Info: Configured localhost for kubespray" echo "Info: Configuring opnfv deployment host for kubespray" echo "-----------------------------------------------------------------------" cd $K8_XCI_PLAYBOOKS -ansible-playbook ${XCI_ANSIBLE_PARAMS} -e XCI_PATH="${XCI_PATH}" \ - -i ${XCI_FLAVOR_ANSIBLE_FILE_PATH}/inventory/inventory.cfg \ - configure-opnfvhost.yml +ansible-playbook ${XCI_ANSIBLE_PARAMS} \ + -i ${XCI_PLAYBOOKS}/dynamic_inventory.py configure-opnfvhost.yml echo "-----------------------------------------------------------------------" echo "Info: Configured opnfv deployment host for kubespray" @@ -65,25 +63,23 @@ if [ $XCI_FLAVOR != "aio" ]; then echo "Info: Configuring target hosts for kubespray" echo "-----------------------------------------------------------------------" cd $K8_XCI_PLAYBOOKS - ansible-playbook ${XCI_ANSIBLE_PARAMS} -e XCI_PATH="${XCI_PATH}" \ - -i ${XCI_FLAVOR_ANSIBLE_FILE_PATH}/inventory/inventory.cfg \ - configure-targethosts.yml + ansible-playbook ${XCI_ANSIBLE_PARAMS} \ + -i ${XCI_PLAYBOOKS}/dynamic_inventory.py configure-targethosts.yml echo "-----------------------------------------------------------------------" echo "Info: Configured target hosts for kubespray" fi echo "Info: Using kubespray to deploy the kubernetes cluster" echo "-----------------------------------------------------------------------" -ssh root@$OPNFV_HOST_IP "set -o pipefail; cd releng-xci/.cache/repos/kubespray;\ - ansible-playbook \ - -i opnfv_inventory/inventory.cfg cluster.yml -b | tee setup-kubernetes.log" +ssh root@$OPNFV_HOST_IP "set -o pipefail; export XCI_FLAVOR=$XCI_FLAVOR; export INSTALLER_TYPE=$INSTALLER_TYPE; \ + cd releng-xci/.cache/repos/kubespray/; ansible-playbook \ + -i opnfv_inventory/dynamic_inventory.py cluster.yml -b | tee setup-kubernetes.log" scp root@$OPNFV_HOST_IP:~/releng-xci/.cache/repos/kubespray/setup-kubernetes.log \ - $LOG_PATH/setup-kubernetes.log + $LOG_PATH/setup-kubernetes.log cd $K8_XCI_PLAYBOOKS ansible-playbook ${XCI_ANSIBLE_PARAMS} \ - -i ${XCI_FLAVOR_ANSIBLE_FILE_PATH}/inventory/inventory.cfg \ - configure-kubenet.yml + -i ${XCI_PLAYBOOKS}/dynamic_inventory.py configure-kubenet.yml echo echo "-----------------------------------------------------------------------" echo "Info: Kubernetes installation is successfully completed!" |