linux - ansible 配置的 Ubuntu 错误

标签 linux ubuntu vagrant ansible

这可能是一件非常简单的事情。我在 Ubuntu 12.04 上使用 ansible-playbook 运行配置:

ansible-playbook web.yml

出现以下错误:

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

所以我尝试更改该文件的权限,但看起来我做不到。首先,我通过运行 ls -l hosts 获取当前权限列表,并打印出我:

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

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

这是我的主机文件:

[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]

和 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

有人可以帮忙吗?

最佳答案

这将删除 x。

chmod 666 ./hosts

关于linux - ansible 配置的 Ubuntu 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26850650/

相关文章:

mysql - 启动 MySQL 时出现错误 "Plugin ' InnoDB 注册为存储引擎失败”

bash - Nmap - RTTVAR 已经增长到超过 2.3 秒,下降到 2.0

ubuntu - Vagrant Shell 以用户身份成功执行,但没有 'stick'

ubuntu - 在 VPS Ubuntu 上获取 Vagrant 配置

ruby-on-rails - Apache2 Ubuntu 默认页面显示

java - Java应用程序在关闭时被终止而没有发送信号

android - 如何在非 Eclipse Android 应用程序中正确包含支持库

linux - 使用 bash 脚本查找以太网地址

linux - ELF文件中的Import Table在哪里?

linux - 尝试在 Ubuntu 20.04 上的 VSCode 中运行 Hello World 项目时出现 Omnisharp 问题