diff options
-rwxr-xr-x | deploy.sh | 9 | ||||
-rwxr-xr-x | functions.sh | 11 | ||||
-rw-r--r-- | playbooks/roles/jump-vm/tasks/main.yaml | 2 |
3 files changed, 15 insertions, 7 deletions
@@ -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 |