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

  • Docker - any way to give access to host USB or serial device?
  • Saving function output into a variable named in an argument
  • access mysql with kubernetes : access denied for user root
  • GitLab-CI Multi Runner php composer cache
  • gnome-desktop docker image works with Linux Mint Host but not CentOS?
  • Docker connection refused when started with -ti bash
  • Do you want to continue [Y/n]?

  • How to create a multi container web application in docker
  • Save docker state (edited postgresql.conf file for example)
  • Configuring docker container with ansible
  • Connection refused in Docker containers communicating through exposed ports
  • How to fix docker so that it stops messing with android studio from connecting to emulator in OSX
  • docker-swarm and docker-compose how to dynamically add nodes and have them resolvable by the services
  • 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.