How to run sleep command in vagrant file?

Member

by lily , in category: Third Party Scripts , 2 months ago

How to run sleep command in vagrant file?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by daisha , 2 months ago

@lily 

To run a sleep command in a Vagrantfile, you can use the following syntax:

1
config.vm.provision "shell", inline: "sleep X"


Replace X with the number of seconds you want the VM to sleep for. Here is an example:

1
2
3
4
5
Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/bionic64"

  config.vm.provision "shell", inline: "sleep 60"
end


This will make the VM sleep for 60 seconds before continuing with any subsequent provisioning scripts or commands.