ansible 配置的 Ubuntu 错误 [英] Ubuntu error with ansible provisioning

查看:25
本文介绍了ansible 配置的 Ubuntu 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能很简单.我正在 Ubuntu 12.04 上使用 ansible-playbook 进行配置:

ansible-playbook web.yml

并收到以下错误:

错误:文件 ./hosts 被标记为可执行文件,但未能正确执行.如果这不应该是一个可执行脚本,请使用 `chmod -x ./hosts` 更正它.

所以我尝试更改该文件的权限,但看起来我不能这样做.首先,我通过运行 ls -l hosts 获取当前权限列表,然后打印我:

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

我试图使用 chmod -x hosts 删除 -x,但之后它返回相同的权限列表,并且配置错误仍然存​​在.>

这是我的主机文件:

[网页]web.local ansible_ssh_host=10.42.1.90 ansible_ssh_port=22[贮存]web-storage.local ansible_ssh_host=10.42.1.91 ansible_ssh_port=22cr-stats.local ansible_ssh_host=10.42.1.92 ansible_ssh_port=22cr-cache.local ansible_ssh_host=10.42.1.93 ansible_ssh_port=22[当地的]web.localweb-storage.localcr-stats.localcr-cache.local#[偏僻的]

和 web.yml:

---- 主机:网络须藤:真的变量:deploy_app_name:网络角色:- 角色:Stouts.redis- 角色:Stouts.python- 角色:Stouts.deploy- 角色:Stouts.nginx- 角色:Stouts.wsgi- 角色:Stouts.celery- 角色:Stouts.supervisor- 主机:存储须藤:真的变量:deploy_app_name:网络角色:- 角色:Stouts.redis

有人可以帮忙吗?

解决方案

这将删除 x.

chmod 666 ./hosts

This may be something very simple. I am running provisioning with ansible-playbook on Ubuntu 12.04:

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:

-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.

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:

---


- 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?

解决方案

This will remove the x.

chmod 666 ./hosts

这篇关于ansible 配置的 Ubuntu 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆