Answering prompt using vagrant file?

后端 未结 1 1676
囚心锁ツ
囚心锁ツ 2021-02-19 05:48

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

config.vm.box = \"ubuntu\"

config.vm.provision          


        
1条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-19 06:24

    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.

    0 讨论(0)
提交回复
热议问题