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

Incorrect syntax for role include causes python stacktrace #10497

Closed
maxamillion opened this issue Mar 18, 2015 · 1 comment
Closed

Incorrect syntax for role include causes python stacktrace #10497

maxamillion opened this issue Mar 18, 2015 · 1 comment
Labels
bug This issue/PR relates to a bug. P2 Priority 2 - Issue Blocks Release
Milestone

Comments

@maxamillion
Copy link
Contributor

Following the ansible documentation for role include, I made a mistake in my syntax location of the { and it caused a python stacktrace instead of emitting an error message:

$ cat site.yml

---
- hosts: testserver
  user: root
  roles:
    - role: { yum_repo, repo_tag: "myrepo", repo_baseurl: "http://example.com/myrepo/x86_64/", repo_name: "custom test repo", repo_enabled: "1", repo_gpg_check: "1" }

$ ansible-playbook site.yml -i inventory.txt 
Traceback (most recent call last):
  File "/usr/bin/ansible-playbook", line 326, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/bin/ansible-playbook", line 266, in main
    pb.run()
  File "/usr/lib/python2.7/site-packages/ansible/playbook/__init__.py", line 313, in run
    play = Play(self, play_ds, play_basedir, vault_password=self.vault_password)
  File "/usr/lib/python2.7/site-packages/ansible/playbook/play.py", line 100, in __init__
    ds = self._load_roles(self.roles, ds)
  File "/usr/lib/python2.7/site-packages/ansible/playbook/play.py", line 414, in _load_roles
    roles = self._build_role_dependencies(roles, [], {})
  File "/usr/lib/python2.7/site-packages/ansible/playbook/play.py", line 225, in _build_role_dependencies
    role_path,role_vars = self._get_role_path(role)
  File "/usr/lib/python2.7/site-packages/ansible/playbook/play.py", line 200, in _get_role_path
    utils.path_dwim(self.basedir, os.path.join('roles', role_name)),
  File "/usr/lib64/python2.7/posixpath.py", line 75, in join
    if b.startswith('/'):
AttributeError: 'dict' object has no attribute 'startswith'
@bcoca bcoca added bug_report P2 Priority 2 - Issue Blocks Release labels Mar 18, 2015
@jimi-c jimi-c added this to the v2 milestone Jul 5, 2015
@jimi-c jimi-c closed this as completed in 37ed756 Jul 23, 2015
@jimi-c
Copy link
Member

jimi-c commented Jul 23, 2015

Closing This Ticket

Hi!

We believe the above commit should resolve this problem for you. This will also be included in the next major release.

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!

@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. P2 Priority 2 - Issue Blocks Release
Projects
None yet
Development

No branches or pull requests

4 participants