stages: - build - deploy Gen-VM: tags: - "virtualbox" - "ansible" - "vagrant" stage: build script: - vboxmanage controlvm windows10R4 poweroff || true - vboxmanage unregistervm --delete windows10R4 || true #- vagrant up > vagrantup.log - vagrant up - vagrant snapshot bootR4 after_script: - vagrant halt windows10R4 artifacts: paths: - vagrantup.log Deploy-VM: tags: - "virtualbox" - "ansible" - "vagrant" stage: deploy when: on_success script: - vboxmanage controlvm win10R4 poweroff || true - vboxmanage unregistervm --delete win10R4 || true - vboxmanage modifyvm windows10R4 --name win10R4 || true - sudo vboxmanage unregistervm win10R4 || true - sudo vboxmanage registervm "/home/VirtualBox VMs/win10R4/win10R4.vbox"