Check if Vagrant provisioning has been done

前端 未结 4 1067
忘了有多久
忘了有多久 2021-01-02 03:43

I am using Vagrant to deploy VMs for development. One of the requirements is that vagrant provision creates a new user (done in a provisioning script I wrote)

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-02 04:12

    This seems to be determined by the action_provision file in the Vagrant data dir (.vagrant/). It's usually located in the same folder as your Vagrantfile.

    So a crude workaround would be to set the ssh username in your Vagrantfile depending on if the file exists or not. I haven't been able to test this though, but if you just rename or remove the action_provision file and go vagrant reload it should provision again.

提交回复
热议问题