通过cygwin运行vagrant up
时遇到以下错误。
stderr: /bin/bash: /home/vagrant/.ansible/tmp/ansible-tmp-1487226010.33-231113224080537/configure.sh: /bin/bash^M: bad interpreter: No such file or directory
选中后,我无法在任何地方找到configure.sh。
无法弄清楚这个问题的原因。这是由于任何缺少的配置。
完整错误:
$ vagrant up
Running on Ruby 2.0.0
Resolved settings:
---
vm:
memory: '8192'
paths:
ptc: C:/MYCERT
mvnrepo: C:/Users/Cmpy/.m2/repository
workspace: C:/code/vagrant/myCode
install: C:/code/vagrant/install
licenses: C:/code/vagrant/licenses
jive:
jrebel: false
gsa:
fgs:
version: '1.0'
Bringing machine 'mySDK' up with 'virtualbox' provider...
==> mySDK: Importing base box 'centos-6.5-x86_64'...
==> mySDK: Matching MAC address for NAT networking...
==> mySDK: Setting the name of the VM: name_1487225947556_22185
==> mySDK: Clearing any previously set network interfaces...
==> mySDK: Preparing network interfaces based on configuration...
mySDK: Adapter 1: nat
mySDK: Adapter 2: hostonly
==> mySDK: Forwarding ports...
mySDK: 10389 => 10389 (adapter 1)
mySDK: 8080 => 8080 (adapter 1)
mySDK: 8443 => 8443 (adapter 1)
mySDK: 5432 => 5432 (adapter 1)
mySDK: 7020 => 7020 (adapter 1)
mySDK: 30000 => 30000 (adapter 1)
mySDK: 19900 => 19900 (adapter 1)
mySDK: 9020 => 9020 (adapter 1)
mySDK: 9030 => 9030 (adapter 1)
mySDK: 22 => 2222 (adapter 1)
==> mySDK: Running 'pre-boot' VM customizations...
==> mySDK: Booting VM...
==> mySDK: Waiting for machine to boot. This may take a few minutes...
mySDK: SSH address: 127.0.0.1:2222
mySDK: SSH username: vagrant
mySDK: SSH auth method: private key
mySDK: Warning: Connection timeout. Retrying...
==> mySDK: Machine booted and ready!
==> mySDK: Checking for guest additions in VM...
==> mySDK: Setting hostname...
==> mySDK: Configuring and enabling network interfaces...
==> mySDK: Mounting shared folders...
mySDK: /PTC => C:/MYCERT
mySDK: /workspace => C:/code/vagrant/myCode
mySDK: /vagrant/ds => C:/code/vagrant/myCode/src/apacheds
mySDK: /vagrant/db => C:/code/vagrant/myCode/src/provisioning/db
mySDK: /vagrant/ssl => C:/code/vagrant/myCode/src/provisioning/ssl
mySDK: /vagrant/vars => C:/code/vagrant/myCode
mySDK: /vagrant/conf => C:/code/vagrant/myCode/src/provisioning/conf
mySDK: /local_repository => C:/Users/Cmpy/.m2/repository
mySDK: /vagrant/.install => C:/code/vagrant/install
mySDK: /vagrant/.licenses => C:/code/vagrant/licenses
mySDK: /vagrant/provisioning => C:/code/vagrant/myCode/src/provisioning
mySDK: /vagrant/jboss_deployment => C:/code/vagrant/myCode/deploy
==> mySDK: Running provisioner: shell...
mySDK: Running: C:/cygwin64/tmp/vagrant-shell20170216-3164-fiz5m3.sh
==> mySDK:
==> mySDK: PLAY [127.0.0.1] **************************************************************
==> mySDK:
==> mySDK: GATHERING FACTS ***************************************************************
==> mySDK: ok: [127.0.0.1]
==> mySDK:
==> mySDK: TASK: [common | Configure Java and ApacheDS] **********************************
==> mySDK: failed: [127.0.0.1] => {"changed": true, "rc": 126}
==> mySDK: stderr: /bin/bash: /home/vagrant/.ansible/tmp/ansible-tmp-1487226010.33-231113224080537/configure.sh: /bin/bash^M: bad interpreter: No such file or directory
==> mySDK:
==> mySDK:
==> mySDK: FATAL: all hosts have already failed -- aborting
==> mySDK:
==> mySDK: PLAY RECAP ********************************************************************
==> mySDK: to retry, use: --limit @/home/vagrant/site.retry
==> mySDK:
==> mySDK: 127.0.0.1 : ok=1 changed=0 unreachable=0 failed=1
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
chmod +x /tmp/vagrant-shell && /tmp/vagrant-shell
Stdout from the command:
PLAY [127.0.0.1] **************************************************************
GATHERING FACTS ***************************************************************
ok: [127.0.0.1]
TASK: [common | Configure Java and ApacheDS] **********************************
failed: [127.0.0.1] => {"changed": true, "rc": 126}
stderr: /bin/bash: /home/vagrant/.ansible/tmp/ansible-tmp-1487226010.33-231113224080537/configure.sh: /bin/bash^M: bad interpreter: No such file or directory
FATAL: all hosts have already failed -- aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/home/vagrant/site.retry
127.0.0.1 : ok=1 changed=0 unreachable=0 failed=1
Stderr from the command:
答案 0 :(得分:0)
我建议installing ansible on Windows 10 Ubuntu subsystem自动处理事情,而不是使用不处理UNIX / LINUX样式行结尾的Cygwin。您会发现这种情况越来越多地与OSS用户合作,当您开始使用ansible保险库时,更不用说这个问题了。