Ansible playbook在使用流浪机器进行测试时抛出“来宾上不存在playbook”
在windows vagrant映像中运行ansible playbook时,输出如下所示:Ansible playbook在使用流浪机器进行测试时抛出“来宾上不存在playbook”,ansible,Ansible,在windows vagrant映像中运行ansible playbook时,输出如下所示: ==> default: Machine booted and ready! Sorry, don't know how to check guest version of Virtualbox Guest Additions on this platform. Stopping installation. ==> default: Checking for guest additions
==> default: Machine booted and ready!
Sorry, don't know how to check guest version of Virtualbox Guest Additions on this platform. Stopping installation.
==> default: Checking for guest additions in VM...
default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default:
default: Guest Additions Version: 5.1.12
default: VirtualBox Version: 5.2
==> default: Mounting shared folders...
default: /vagrant => /Users/aaron.west/Workspace/hss-iaas/ansible-repo/tmp
==> default: Running provisioner: ansible_local...
`playbook` does not exist on the guest: /vagrant/test/local.yml
- hosts: local
gather_facts: yes
connection: local
become: yes
become_user: root
roles:
- ../roles/java
可在此处找到剧本:
我使用的vagrant windows server 2016映像是:mwrock/Windows2016
剧本看起来像:
==> default: Machine booted and ready!
Sorry, don't know how to check guest version of Virtualbox Guest Additions on this platform. Stopping installation.
==> default: Checking for guest additions in VM...
default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default:
default: Guest Additions Version: 5.1.12
default: VirtualBox Version: 5.2
==> default: Mounting shared folders...
default: /vagrant => /Users/aaron.west/Workspace/hss-iaas/ansible-repo/tmp
==> default: Running provisioner: ansible_local...
`playbook` does not exist on the guest: /vagrant/test/local.yml
- hosts: local
gather_facts: yes
connection: local
become: yes
become_user: root
roles:
- ../roles/java
Running provisioner:ansible_local
——所以流浪汉试图在客人内部执行playbook
您可能需要重构剧本以使用provisioner。根据:
Ansible本地供应商要求所有Ansible剧本
文件可在来宾计算机上的
设置路径选项。通常这些文件最初是
出现在主机上(作为Vagrant项目的一部分),并且
很容易与一个流浪同步文件夹共享它们
为此,请添加以下内容:
config.vm.synced_folder ".", "/vagrant"
在来宾服务器上的“/vagrant”文件夹中共享来自主机的“vagrant”文件夹,它似乎在其中查找剧本,如您收到的错误消息所示