1

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?

arthur
  • 223
  • 2
  • 12
  • Can you post the contents of hosts and web.yml – Leon Nov 10 '14 at 18:50
  • yes, I have added my hosts and web.yml file to the question. – arthur Nov 10 '14 at 19:45
  • Check that you are in the Vagrant group or are the Vagrant user, because that file is owned by that user. Run `id` to verify, and also run that as the super user if you're running with sudo. Also, can you tell us the underlying file system? Run `df -T` from that directory, or just `mount` I ask because I've seen partitions like exfat and NTFS show up as 777. – Damon Nov 11 '14 at 05:15

1 Answers1

0

This will remove the x.

chmod 666 ./hosts
Hy L
  • 522
  • 5
  • 11
  • 1
    this didn't change the permissions in my case, it is still showing: -rwxrwxrwx – arthur Nov 10 '14 at 19:46
  • if that didn't change permissions, your script is on a read-only drive or something really strange. You don't have an Ansible problem. @arthur – tedder42 Nov 10 '14 at 20:50
  • 1
    If you can't change the X status of your files, you might be running Ubuntu in VirtualBox using SharedFolders - that was my problem. My solution was to create an "executable inventory" file instead of a static one. You can see solutions to that problem here: http://stackoverflow.com/questions/26859360/cant-use-ansible-inventory-file-because-it-is-executable/27046560#27046560 – Steve Midgley Nov 20 '14 at 18:11