Bug 821396 - [abrt] ansible-0.3.1-1.fc16: playbook.py:368:_run_task:AttributeError: 'str' object has no attribute 'get'
[abrt] ansible-0.3.1-1.fc16: playbook.py:368:_run_task:AttributeError: 'str' ...
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: ansible (Show other bugs)
16
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Tim Bielawa
Fedora Extras Quality Assurance
abrt_hash:d7590c874f1d7ba271679a4bb8d...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-14 07:12 EDT by andreas.davour
Modified: 2012-05-16 16:53 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-05-16 16:53:17 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description andreas.davour 2012-05-14 07:12:18 EDT
libreport version: 2.0.8
abrt_version:   2.0.7
cmdline:        /usr/bin/python /usr/bin/ansible-playbook -k Yaml/playbook-tc2-resolver.yaml
executable:     /usr/bin/ansible-playbook
kernel:         3.3.4-3.fc16.x86_64
reason:         playbook.py:368:_run_task:AttributeError: 'str' object has no attribute 'get'
time:           Mon 14 May 2012 11:04:00 AM CEST
uid:            1000
username:       ante

backtrace:
:playbook.py:368:_run_task:AttributeError: 'str' object has no attribute 'get'
:
:Traceback (most recent call last):
:  File "/usr/bin/ansible-playbook", line 100, in <module>
:    sys.exit(main(sys.argv[1:]))
:  File "/usr/bin/ansible-playbook", line 81, in main
:    pb.run()
:  File "/usr/lib/python2.7/site-packages/ansible/playbook.py", line 239, in run
:    self._run_play(pattern)
:  File "/usr/lib/python2.7/site-packages/ansible/playbook.py", line 572, in _run_play
:    port=port
:  File "/usr/lib/python2.7/site-packages/ansible/playbook.py", line 368, in _run_task
:    name    = task.get('name', None)
:AttributeError: 'str' object has no attribute 'get'
:
:Local variables in innermost frame:
:remote_user: 'root'
:conditional: False
:handlers: []
:pattern: 'tc2'
:self: <ansible.playbook.PlayBook object at 0xe94450>
:sudo: False
:task: 'name template in resolv.conf file'
:port: 22
:transport: 'paramiko'

comment:
:I ran the ansible playbook and it failed with the output shown. It happens everytime,
:
:Playbook:
:---
:- hosts: tc2
:  user: root
:  tasks:
:  - name resolver file copy
:  action: template src=/home/ante/Ansible/Yaml/resolv.conf-templ.j2 dest=/etc/resolv.conf
:
:the template file:
:# this is the resolv.conf for {{ ansible_hostname }}
:# template copied by ansible
:search a.snowmen.se
:timeout:1
:nameserver 172.30.0.18
:nameserver 172.30.0.12
Comment 1 Tim Bielawa 2012-05-16 16:53:17 EDT
(In reply to comment #0)
> comment:
> :I ran the ansible playbook and it failed with the output shown. It happens
> everytime,
> :
> :Playbook:
> :---
> :- hosts: tc2
> :  user: root
> :  tasks:
> :  - name resolver file copy
> :  action: template src=/home/ante/Ansible/Yaml/resolv.conf-templ.j2
> dest=/etc/resolv.conf

Looks like your YAML is a little off, it's VERY sensitive to indentation. Where you have:

> ---
> - hosts: tc2
>   user: root
>   tasks:
>   - name resolver file copy
>   action: template src=/home/ante/Ansible/Yaml/resolv.conf-templ.j2 dest=/etc/resolv.conf

You should have:

> ---
> - hosts: tc2
>   user: root
>   tasks:
>   - name resolver file copy
>     action: template src=/home/ante/Ansible/Yaml/resolv.conf-templ.j2 dest=/etc/resolv.conf


See this reference for an example with the correct syntax:

http://ansible.github.com/playbooks.html#playbook-example


If this doesn't fix the issue I invite you to visit the mailing lists or the IRC channel for official support. They will be able help you much better than I can.

The resources section of their website has that information: http://ansible.github.com/#resources

Thanks!

Note You need to log in before you can comment on or make changes to this bug.