gpt4 book ai didi

使用 Vagrant 机器测试时 Ansible 剧本抛出 `playbook does not exist on the guest`

转载 作者:行者123 更新时间:2023-12-05 04:01:58 26 4
gpt4 key购买 nike

在 windows vagrant image 中运行 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 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

剧本可以在这里找到:https://galaxy.ansible.com/lean_delivery/java

我正在使用的 vagrant windows server 2016 图像是:mwrock/Windows2016

剧本看起来像:

- hosts: local
gather_facts: yes
connection: local
become: yes
become_user: root
roles:
- ../roles/java

最佳答案

根据 ansible_local documentation :

The Ansible Local provisioner requires that all the Ansible Playbook files are available on the guest machine, at the location referred by the provisioning_path option. Usually these files are initially present on the host machine (as part of your Vagrant project), and it is quite easy to share them with a Vagrant Synced Folder.

为此,添加以下内容:

config.vm.synced_folder ".", "/vagrant"

This configuration在 guest 的 “/vagrant” 文件夹中共享来自主机的 vagrant 文件夹,它似乎在其中寻找 playbook,如您收到的错误消息所示。

关于使用 Vagrant 机器测试时 Ansible 剧本抛出 `playbook does not exist on the guest`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54796667/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com