Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spaces in the path of roles_path causes playbooks to fail in 1.7 #8555

Closed
samdoran opened this issue Aug 11, 2014 · 10 comments
Closed

Spaces in the path of roles_path causes playbooks to fail in 1.7 #8555

samdoran opened this issue Aug 11, 2014 · 10 comments
Labels
bug This issue/PR relates to a bug.

Comments

@samdoran
Copy link
Contributor

Issue Type:

Bug Report

Ansible Version:

ansible 1.7

Environment:
ProductName:    Mac OS X
ProductVersion: 10.9.4
BuildVersion:   13E28
Summary:

Spaces in the path of roles_path causes playbooks to fail. This works fine in 1.6.10 but is broken in 1.7.

Steps To Reproduce:
  1. Create ~/Projects/Ansible Sites/playbooks/test.yml playbook

---
- hosts: test.acme.com

  roles:
    - test_ping
  1. Create ~/Projects/Ansible Sites/roles/test_ping role with one task in main.yml

---
- ping:
  1. Add a relative path to roles_path in ~/.ansible.cfg that contains a parent directory with a space in the name:
roles_path = ./roles:./librarian_roles:../roles:../librarian_roles
  1. Run ansible-playbook playbooks/test.yml from ~/Projects/Ansible Sites
cd ~/Projects/Ansible\ Sites
ansible-playbook playbooks/test.yml
Expected Results:

Playbook will find roles in the directories specified in roles_path and run successfully.

PLAY [test.acme.com] ****************************************************

GATHERING FACTS ***************************************************************
ok: [test.acme.com]

TASK: [test_ping | ping ] *****************************************************
ok: [test.acme.com]

PLAY RECAP ********************************************************************
test.acme.com        : ok=2    changed=0    unreachable=0    failed=0
Actual Results:

Playbook fails to run because it cannot find the role.

ERROR: file could not read: /Users/sdoran/Projects/Ansible Sites/playbooks/'/Users/sdoran/Projects/Ansible Sites/roles/test_ping/tasks/main.yml'
@LeonB
Copy link

LeonB commented Aug 18, 2014

Can confirm: is happening for me too. Moving the ansible directory to a path without a space fixed the issue.

@samdoran
Copy link
Contributor Author

I made a symlink to the path with spaces, then I pointed my roles_path to the symlink. The path to the symlink has no spaces.

ls -l /usr/local/etc/ansible/roles
/usr/local/etc/ansible/roles -> /Users/john/Ansible Sites/roles

# ~/.ansible.cfg
roles_path = /usr/local/etc/ansible/roles

@derelm
Copy link

derelm commented Sep 21, 2014

I experienced the same, downgraded to 1.6.x

@Athena88-zz
Copy link

hi derelm where can I get 1.6.x?

@herbyg-axial
Copy link
Contributor

@athena88 $ pip install ansible=='1.6.10'

@rubas
Copy link

rubas commented Nov 9, 2014

I can confirm this for Ansible 1.7.2 and Yosemite (OSX 10.10).

@c-nichols
Copy link

Can confirm with Ansible 1.7.2 on debian wheezy and ubuntu 12.04

@EmergentBehavior
Copy link

Can also confirm for Ansible 1.7.2 (installed via homebrew) on OSX 10.10.1

@jimi-c
Copy link
Member

jimi-c commented Jun 23, 2015

Hi, this situation is no longer present in the devel branch (which will be ansible 2.0). Here is sample output using your example above:

[root@jimi 8555]# mkdir "subdir spaces"
[root@jimi 8555]# ll
total 4
drwxr-xr-x. 2 root root 4096 Jun 23 10:31 subdir spaces
[root@jimi 8555]# cd subdir\ spaces/
[root@jimi subdir spaces]# ansible-galaxy init testing
- testing was created successfully
[root@jimi subdir spaces]# mkdir roles
[root@jimi subdir spaces]# mv testing roles
[root@jimi subdir spaces]# vi roles/testing/tasks/main.yml 
[root@jimi subdir spaces]# vi test.yml
[root@jimi subdir spaces]# ansible-playbook -vv test.yml 
1 plays in test.yml
PLAY: ***************************************************************************
TASK [testing : testing : debug msg=here i am] **********************************
ok: [localhost] => {
    "msg": "here i am", 
    "changed": false
}
PLAY RECAP **********************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=0   
[root@jimi subdir spaces]# cd ..
[root@jimi 8555]# ansible-playbook -vv subdir\ spaces/test.yml 
1 plays in subdir spaces/test.yml
PLAY: ***************************************************************************
TASK [testing : testing : debug msg=here i am] **********************************
ok: [localhost] => {
    "msg": "here i am", 
    "changed": false
}
PLAY RECAP **********************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=0   

If you continue seeing any problems related to this issue, or if you have any further questions, please let us know by stopping by one of the two mailing lists, as appropriate:

Because this project is very active, we're unlikely to see comments made on closed tickets, but the mailing list is a great way to ask questions, or post if you don't think this particular issue is resolved.

Thank you!

@jimi-c jimi-c closed this as completed Jun 23, 2015
@Athena88-zz
Copy link

Thanks

On Tue, Jun 23, 2015 at 10:33 PM, James Cammarata notifications@github.com
wrote:

Closed #8555 #8555.


Reply to this email directly or view it on GitHub
#8555 (comment).

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 6, 2018
@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug.
Projects
None yet
Development

No branches or pull requests