From e286a9a4aad9bfca02e35c2486414d33a4f053d7 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Mon, 12 Mar 2018 09:47:55 +0000 Subject: xci: Rename XCI_ANSIBLE_VERBOSITY to XCI_ANSIBLE_PARAMS We don't quite need a specific env variable just for Ansible verbosity so we can rename this variable to make it clear that it can be used to pass any Ansible option to XCI. Change-Id: Ie20517d4b563bfc6daeb27848168d36da7014cee Signed-off-by: Markos Chandras --- xci/installer/osa/deploy.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'xci/installer/osa') diff --git a/xci/installer/osa/deploy.sh b/xci/installer/osa/deploy.sh index 1e442918..fa6098ba 100755 --- a/xci/installer/osa/deploy.sh +++ b/xci/installer/osa/deploy.sh @@ -39,7 +39,7 @@ fi echo "Info: Configuring localhost for openstack-ansible" echo "-----------------------------------------------------------------------" cd $XCI_PLAYBOOKS -ansible-playbook ${XCI_ANSIBLE_VERBOSITY} -e XCI_PATH="${XCI_PATH}" -i inventory configure-localhost.yml +ansible-playbook ${XCI_ANSIBLE_PARAMS} -e XCI_PATH="${XCI_PATH}" -i inventory configure-localhost.yml echo "-----------------------------------------------------------------------" echo "Info: Configured localhost host for openstack-ansible" @@ -57,7 +57,7 @@ echo "Info: Configured localhost host for openstack-ansible" echo "Info: Configuring opnfv deployment host for openstack-ansible" echo "-----------------------------------------------------------------------" cd $OSA_XCI_PLAYBOOKS -ansible-playbook ${XCI_ANSIBLE_VERBOSITY} -e XCI_PATH="${XCI_PATH}" -i ${XCI_FLAVOR_ANSIBLE_FILE_PATH}/inventory \ +ansible-playbook ${XCI_ANSIBLE_PARAMS} -e XCI_PATH="${XCI_PATH}" -i ${XCI_FLAVOR_ANSIBLE_FILE_PATH}/inventory \ configure-opnfvhost.yml echo "-----------------------------------------------------------------------" echo "Info: Configured opnfv deployment host for openstack-ansible" @@ -77,7 +77,7 @@ if [[ $XCI_FLAVOR != "aio" ]]; then echo "Info: Configuring target hosts for openstack-ansible" echo "-----------------------------------------------------------------------" cd $OSA_XCI_PLAYBOOKS - ansible-playbook ${XCI_ANSIBLE_VERBOSITY} -e XCI_PATH="${XCI_PATH}" -i ${XCI_FLAVOR_ANSIBLE_FILE_PATH}/inventory \ + ansible-playbook ${XCI_ANSIBLE_PARAMS} -e XCI_PATH="${XCI_PATH}" -i ${XCI_FLAVOR_ANSIBLE_FILE_PATH}/inventory \ configure-targethosts.yml echo "-----------------------------------------------------------------------" echo "Info: Configured target hosts" @@ -90,7 +90,7 @@ fi #------------------------------------------------------------------------------- echo "Info: Setting up target hosts for openstack-ansible" echo "-----------------------------------------------------------------------" -ssh root@$OPNFV_HOST_IP "set -o pipefail; openstack-ansible ${XCI_ANSIBLE_VERBOSITY} \ +ssh root@$OPNFV_HOST_IP "set -o pipefail; openstack-ansible ${XCI_ANSIBLE_PARAMS} \ releng-xci/.cache/repos/openstack-ansible/playbooks/setup-hosts.yml | tee setup-hosts.log " scp root@$OPNFV_HOST_IP:~/setup-hosts.log $LOG_PATH/setup-hosts.log echo "-----------------------------------------------------------------------" @@ -112,7 +112,7 @@ echo "Info: Set up target hosts for openstack-ansible successfuly" echo "Info: Gathering facts" echo "-----------------------------------------------------------------------" ssh root@$OPNFV_HOST_IP "set -o pipefail; cd releng-xci/.cache/repos/openstack-ansible/playbooks; \ - ansible ${XCI_ANSIBLE_VERBOSITY} -m setup -a gather_subset=network,hardware,virtual all" + ansible ${XCI_ANSIBLE_PARAMS} -m setup -a gather_subset=network,hardware,virtual all" echo "-----------------------------------------------------------------------" #------------------------------------------------------------------------------- @@ -123,7 +123,7 @@ echo "-----------------------------------------------------------------------" echo "Info: Setting up infrastructure" echo "-----------------------------------------------------------------------" echo "xci: running ansible playbook setup-infrastructure.yml" -ssh root@$OPNFV_HOST_IP "set -o pipefail; openstack-ansible ${XCI_ANSIBLE_VERBOSITY} \ +ssh root@$OPNFV_HOST_IP "set -o pipefail; openstack-ansible ${XCI_ANSIBLE_PARAMS} \ releng-xci/.cache/repos/openstack-ansible/playbooks/setup-infrastructure.yml | tee setup-infrastructure.log" scp root@$OPNFV_HOST_IP:~/setup-infrastructure.log $LOG_PATH/setup-infrastructure.log echo "-----------------------------------------------------------------------" @@ -157,7 +157,7 @@ echo "Info: Database cluster verification successful!" #------------------------------------------------------------------------------- echo "Info: Installing OpenStack on target hosts" echo "-----------------------------------------------------------------------" -ssh root@$OPNFV_HOST_IP "set -o pipefail; openstack-ansible ${XCI_ANSIBLE_VERBOSITY} \ +ssh root@$OPNFV_HOST_IP "set -o pipefail; openstack-ansible ${XCI_ANSIBLE_PARAMS} \ releng-xci/.cache/repos/openstack-ansible/playbooks/setup-openstack.yml | tee opnfv-setup-openstack.log" scp root@$OPNFV_HOST_IP:~/opnfv-setup-openstack.log $LOG_PATH/opnfv-setup-openstack.log echo "-----------------------------------------------------------------------" -- cgit 1.2.3-korg From 16b1131e8deb32df1eea1cf7c17d35ed4c29bb5f Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Mon, 12 Mar 2018 09:50:06 +0000 Subject: xci: Pass the XCI_PATH variable to all Ansible calls The XCI_PATH variable is used by various playbooks to find the root directory of the XCI repository so it's much cleaner to pass it on every Ansible call. Change-Id: Ifc0b77fa767e48bd1dc6daa44c6251c02983fd4d Signed-off-by: Markos Chandras --- xci/installer/osa/deploy.sh | 6 +++--- xci/xci-deploy.sh | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'xci/installer/osa') diff --git a/xci/installer/osa/deploy.sh b/xci/installer/osa/deploy.sh index fa6098ba..3c27fd79 100755 --- a/xci/installer/osa/deploy.sh +++ b/xci/installer/osa/deploy.sh @@ -39,7 +39,7 @@ fi echo "Info: Configuring localhost for openstack-ansible" echo "-----------------------------------------------------------------------" cd $XCI_PLAYBOOKS -ansible-playbook ${XCI_ANSIBLE_PARAMS} -e XCI_PATH="${XCI_PATH}" -i inventory configure-localhost.yml +ansible-playbook ${XCI_ANSIBLE_PARAMS} -i inventory configure-localhost.yml echo "-----------------------------------------------------------------------" echo "Info: Configured localhost host for openstack-ansible" @@ -57,7 +57,7 @@ echo "Info: Configured localhost host for openstack-ansible" echo "Info: Configuring opnfv deployment host for openstack-ansible" echo "-----------------------------------------------------------------------" cd $OSA_XCI_PLAYBOOKS -ansible-playbook ${XCI_ANSIBLE_PARAMS} -e XCI_PATH="${XCI_PATH}" -i ${XCI_FLAVOR_ANSIBLE_FILE_PATH}/inventory \ +ansible-playbook ${XCI_ANSIBLE_PARAMS} -i ${XCI_FLAVOR_ANSIBLE_FILE_PATH}/inventory \ configure-opnfvhost.yml echo "-----------------------------------------------------------------------" echo "Info: Configured opnfv deployment host for openstack-ansible" @@ -77,7 +77,7 @@ if [[ $XCI_FLAVOR != "aio" ]]; then echo "Info: Configuring target hosts for openstack-ansible" echo "-----------------------------------------------------------------------" cd $OSA_XCI_PLAYBOOKS - ansible-playbook ${XCI_ANSIBLE_PARAMS} -e XCI_PATH="${XCI_PATH}" -i ${XCI_FLAVOR_ANSIBLE_FILE_PATH}/inventory \ + ansible-playbook ${XCI_ANSIBLE_PARAMS} -i ${XCI_FLAVOR_ANSIBLE_FILE_PATH}/inventory \ configure-targethosts.yml echo "-----------------------------------------------------------------------" echo "Info: Configured target hosts" diff --git a/xci/xci-deploy.sh b/xci/xci-deploy.sh index cf56151c..8decec05 100755 --- a/xci/xci-deploy.sh +++ b/xci/xci-deploy.sh @@ -64,6 +64,8 @@ source "$XCI_PATH/xci/config/${XCI_FLAVOR}-vars" source "$XCI_PATH/xci/installer/${XCI_INSTALLER}/env" &>/dev/null || true # source xci configuration source $XCI_PATH/xci/config/env-vars +# Make sure we pass XCI_PATH everywhere +export XCI_ANSIBLE_PARAMS+=" -e XCI_PATH=${XCI_PATH}" if [[ -z $(echo $PATH | grep "$HOME/.local/bin") ]]; then export PATH="$HOME/.local/bin:$PATH" -- cgit 1.2.3-korg From 6514b1ac8b4cc5b98085776546077cd588d0739e Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Mon, 12 Mar 2018 10:40:39 +0000 Subject: xci: OSA: Fix warning about missing inventory file This is similar to 346079ea1b8dbda0c5e282c18f30cbac7e907d1e ("xci: Fix warning about missing inventory file") This playbook only affects localhost so make it explicit. Fixes: [WARNING]: Host file not found: inventory [WARNING]: provided hosts list is empty, only localhost is available Change-Id: If8548a36498ea3191de33cff94acbaee6ed04ce3 Signed-off-by: Markos Chandras --- xci/installer/osa/deploy.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xci/installer/osa') diff --git a/xci/installer/osa/deploy.sh b/xci/installer/osa/deploy.sh index 3c27fd79..6702b678 100755 --- a/xci/installer/osa/deploy.sh +++ b/xci/installer/osa/deploy.sh @@ -39,7 +39,7 @@ fi echo "Info: Configuring localhost for openstack-ansible" echo "-----------------------------------------------------------------------" cd $XCI_PLAYBOOKS -ansible-playbook ${XCI_ANSIBLE_PARAMS} -i inventory configure-localhost.yml +ansible-playbook ${XCI_ANSIBLE_PARAMS} -i "localhost," configure-localhost.yml echo "-----------------------------------------------------------------------" echo "Info: Configured localhost host for openstack-ansible" -- cgit 1.2.3-korg