From e34b4d93d5e288bdbb5ec798602ea5e8f1bc3985 Mon Sep 17 00:00:00 2001 From: Rihab Banday Date: Tue, 6 Oct 2020 09:45:11 +0200 Subject: [PATCH] Switch to older settings for ansible playbooks and VM creation steps This change introduces two (older) settings needed for CentOS 7 which were removed by recent patches that were tested only on Ubuntu 16.04. These settings have been already tested on Ubtunu 16.04. Change-Id: I3039d650b59869d45e11afdda8827c850f686195 Signed-off-by: Rihab Banday Co-Authored-By: Victor Morales Reviewed-on: https://gerrit.opnfv.org/gerrit/c/kuberef/+/71233 Tested-by: jenkins-ci Reviewed-by: Georg Kunz --- deploy.sh | 9 +++------ functions.sh | 11 +++++++++++ playbooks/roles/jump-vm/tasks/main.yaml | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/deploy.sh b/deploy.sh index 5a012e7..b45825c 100755 --- a/deploy.sh +++ b/deploy.sh @@ -33,20 +33,17 @@ source "$CURRENTPATH/deploy.env" # --------------------------------------------------------------------- # bootstrap install prerequisites # --------------------------------------------------------------------- -ansible-playbook -i "$CURRENTPATH"/inventory/localhost.ini \ - "$CURRENTPATH"/playbooks/bootstrap.yaml +run_playbook bootstrap # --------------------------------------------------------------------- # Create jump VM from which the installation is performed # --------------------------------------------------------------------- -ansible-playbook -i "$CURRENTPATH"/inventory/localhost.ini \ - "$CURRENTPATH"/playbooks/jump-vm.yaml +run_playbook jump-vm # --------------------------------------------------------------------- # Create BMRA config based on IDF and PDF # --------------------------------------------------------------------- -ansible-playbook -i "$CURRENTPATH"/inventory/localhost.ini \ - "$CURRENTPATH"/playbooks/bmra-config.yaml +run_playbook bmra-config # --------------------------------------------------------------------- # Copy files needed by Infra engine & BMRA in the jumphost VM diff --git a/functions.sh b/functions.sh index fd19c46..20c4d5d 100755 --- a/functions.sh +++ b/functions.sh @@ -178,3 +178,14 @@ sudo docker run --rm \ ansible-playbook -i /bmra/inventory.ini /bmra/playbooks/cluster.yml EOF } + +# Executes a specific Ansible playbook +run_playbook() { + ansible_cmd="$(command -v ansible-playbook)" + ansible_cmd+=" -i $CURRENTPATH/inventory/localhost.ini" + ansible_cmd+=" -e ansible_python_interpreter=$(command -v python)" + if [ "${DEBUG:-false}" == "true" ]; then + ansible_cmd+=" -vvv" + fi + eval "$ansible_cmd $CURRENTPATH/playbooks/${1}.yaml" +} diff --git a/playbooks/roles/jump-vm/tasks/main.yaml b/playbooks/roles/jump-vm/tasks/main.yaml index f5f6154..2c0cc37 100644 --- a/playbooks/roles/jump-vm/tasks/main.yaml +++ b/playbooks/roles/jump-vm/tasks/main.yaml @@ -85,7 +85,7 @@ --disk path={{ workspace }}/kuberef-jump.qcow2,format=qcow2 \ --disk {{ workspace }}/kuberef-jump-cidata.iso,device=cdrom \ --network network=default,model=virtio,mac='{{ jumphost.interfaces[engine.net_config[engine.public_network].interface].mac_address }}' \ - --network bridge=pxebr,model=virtio,mac='{{ jumphost.interfaces[engine.net_config[engine.pxe_network].interface].mac_address }}' \ + --network bridge=pxebr,model=rtl8139,mac='{{ jumphost.interfaces[engine.net_config[engine.pxe_network].interface].mac_address }}' \ --import --noautoconsole" - name: start jump VM -- 2.16.6