简体   繁体   English

Ansible置备的Ubuntu错误

[英]Ubuntu error with ansible provisioning

This may be something very simple. 这可能很简单。 I am running provisioning with ansible-playbook on Ubuntu 12.04: 我在Ubuntu 12.04上使用ansible-playbook运行资源调配:

ansible-playbook web.yml

and getting the following error: 并得到以下错误:

ERROR: The file ./hosts 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`.

So I tried to change permissions on that file but it looks like I can't do that. 因此,我尝试更改该文件的权限,但看起来我无法做到这一点。 First I get the list of current permissions by running ls -l hosts and it prints me: 首先,我通过运行ls -l hosts获得当前权限的列表,并显示以下信息:

-rwxrwxrwx 1 vagrant vagrant 413 Nov 10 14:55 hosts

I was trying to remove -x with chmod -x hosts but after that it returns me the same list of permissions and the error with the provisioning persist. 我试图使用chmod -x主机删除-x ,但是此后它向我返回相同的权限列表,并且配置错误仍然存​​在。

Here is my hosts file: 这是我的主机文件:

[web]
web.local ansible_ssh_host=10.42.1.90 ansible_ssh_port=22

[storage]
web-storage.local ansible_ssh_host=10.42.1.91 ansible_ssh_port=22
cr-stats.local ansible_ssh_host=10.42.1.92 ansible_ssh_port=22
cr-cache.local ansible_ssh_host=10.42.1.93 ansible_ssh_port=22

[local]
web.local
web-storage.local
cr-stats.local
cr-cache.local


#[remote]

and web.yml: 和web.yml:

---


- hosts: web
  sudo: True
  vars:
    deploy_app_name: web
  roles:
    - role: Stouts.redis
    - role: Stouts.python
    - role: Stouts.deploy
    - role: Stouts.nginx
    - role: Stouts.wsgi
    - role: Stouts.celery
    - role: Stouts.supervisor

- hosts: storage
  sudo: True
  vars:
    deploy_app_name: web
  roles:
    - role: Stouts.redis

Can anyone help with that? 有人可以帮忙吗?

这将删除x。

chmod 666 ./hosts

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM