“只有一个'path`或`inline`可以设置为”在vagrant up上

时间:2016-09-17 05:10:37

标签: ansible vagrant vlad-drupal

我正在尝试使用vlad在Windows上使用vagrant安装drupal。 我安装了流浪汉。 我用babun安装了Cygwin,最后我安装了ansible。 当我流浪时,我得到:“只有pathinline中的一个可能被设置为”错误。

{ vlad-master }  » vagrant up                                                     ~/vlad-master 1
Found project settings file: C:/Users/maggie/.babun/cygwin/home/maggie/vlad-master/vlad_guts/vlad_settings.yml

Bringing machine 'vlad' up with 'virtualbox' provider...
==> vlad: Running triggers before up...
==> vlad: Executing pre 'provision' setup trigger
==> vlad: Executing command "ansible-galaxy install -r vlad_guts/playbooks/requirements.yml --force"...
==> vlad: - extracting aberdeencloud_cli to /home/maggie/vlad-master/vlad_guts/playbooks/ext_roles/aberdeencloud_cli
==> vlad: - aberdeencloud_cli was installed successfully
==> vlad: - extracting pantheon_cli to /home/maggie/vlad-master/vlad_guts/playbooks/ext_roles/pantheon_cli
==> vlad: - pantheon_cli was installed successfully
==> vlad: - extracting imagemagick to /home/maggie/vlad-master/vlad_guts/playbooks/ext_roles/imagemagick
==> vlad: - imagemagick was installed successfully
==> vlad: - extracting sendmail to /home/maggie/vlad-master/vlad_guts/playbooks/ext_roles/sendmail
==> vlad: - sendmail was installed successfully
==> vlad: - extracting tomcat to /home/maggie/vlad-master/vlad_guts/playbooks/ext_roles/tomcat
==> vlad: - tomcat was installed successfully
==> vlad: - extracting solr to /home/maggie/vlad-master/vlad_guts/playbooks/ext_roles/solr
==> vlad: - solr was installed successfully
==> vlad: - adding dependency: hashbangcode.tomcat
==> vlad: - extracting drush to /home/maggie/vlad-master/vlad_guts/playbooks/ext_roles/drush
==> vlad: - drush was installed successfully
==> vlad: - extracting platformsh_cli to /home/maggie/vlad-master/vlad_guts/playbooks/ext_roles/platformsh_cli
==> vlad: - platformsh_cli was installed successfully
==> vlad: - downloading role 'tomcat', owned by hashbangcode
==> vlad: - downloading role from https://github.com/hashbangcode/ansible-role-tomcat/archive/master.tar.gz
==> vlad: - extracting hashbangcode.tomcat to /home/maggie/vlad-master/vlad_guts/playbooks/ext_roles/hashbangcode.tomcat
==> vlad: - hashbangcode.tomcat was installed successfully
==> vlad: Command execution finished.
==> vlad: Executing 'up' setup trigger
==> vlad: Creating C:/Users/maggie/.babun/cygwin/home/maggie/vlad-master/vlad_guts/host.ini
There are errors in the configuration of this machine. Please fix
the following errors and try again:

shell provisioner:
* Only one of `path` or `inline` may be set.

1 个答案:

答案 0 :(得分:1)

阅读vagrant shell provisioning文档

  

shell配置程序采用各种选项。 inlinepath中的一个是   需要:

     
      
  • inline(字符串) - 指定要在内核上执行的shell命令   远程机器。有关更多信息,请参阅下面的内联脚本部分   信息。

  •   
  • path(字符串) - 要上载和执行的shell脚本的路径。它可以   是一个相对于项目Vagrantfile或远程脚本的脚本   (像一个要点)。

  •   

所以你可以拥有

Vagrant.configure("2") do |config|
  config.vm.provision "shell",
    inline: "echo Hello, World"
end

Vagrant.configure("2") do |config|
  config.vm.provision "shell", path: "script.sh"
end

您可以在Vagrantfile中查看您的shell配置程序,并确保配置程序在同一个块中没有pathinline,它必须是一个另一个