Answering prompt using vagrant file?

Is it possible to add a script to a Vagrantfile that answers a prompt. I am provisioning a ubuntu box for docker = "ubuntu"

config.vm.provision :shell, :inline => "sudo apt-get update"

config.vm.provision :shell, :inline => "sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring"

After running the last command, there is a prompt that asks

  • ERROR: repository hyperledger/fabric-tools not found: does not exist or no pull access
  • How to let Docker containers broadcast their IP addresses or hostnames to each other?
  • docker push error “denied: requested access to the resource is denied”
  • How to link docker images to their composing layers on the disk?
  • docker container fails to start with docker-compose exit status 2, code 128
  • (mac) dockers , how to connect to a redis server in the hosting machine from a containter
  • Do you want to continue [Y/n]?

  • Docker build times long with npm global install angular-cli
  • ssh into boot2docker - can you see -v folders from within boot2docker vm
  • Docker log file: How to know the time of notes?
  • Bind container port to host inside Dockerfile
  • How does Istio compare to Traefik?
  • How do I run kurento in a docker container, with kurento hello world example on host machine
  • One Solution collect form web for “Answering prompt using vagrant file?”

    An easier solution would be to use the -y option of apt-get:

    config.vm.provision :shell, :inline => "sudo apt-get -y install linux-image-generic-lts-raring linux-headers-generic-lts-raring"

    See the manual:

    -y, –yes, –assume-yes Automatic yes to prompts. Assume “yes” as answer to all prompts and run non-interactively. If an undesirable
    situation, such as changing a held package or removing an essential
    package, occurs then apt-get will abort.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.