我正在尝试运行Ansible清单文件ansible -i hosts-prod all -u root -m ping,但是此消息失败:
ERROR: The file hosts-prod is marked as executable,
but failed to execute correctly. If this is not supposed
to be an executable script, correct this with
`chmod -x hosts-prod`.
Run Code Online (Sandbox Code Playgroud)
我相信这是因为我正在使用Virtual Box和共享文件夹,它们强制我的所有文件都是ug + rwx.并且vbox不允许更改共享文件夹的权限(至少来自Windows的共享文件夹,这是我的情况)
有没有办法让Ansible运行这个文件?我可以看到几个选项:
hosts-prod成为可执行文件.我不知道这涉及到什么(显然是Ansible的新手).所有的帮助/想法赞赏!
实际的hosts-prod配置文件如下所示,因此欢迎任何有关使其内部可执行的提示:
web01 ansible_ssh_host=web01.example.com
db01 ansible_ssh_host=db01.example.com
[webservers]
web01
[dbservers]
db01
[all:vars]
ansible_ssh_user=root
Run Code Online (Sandbox Code Playgroud)