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

ERROR! 'debug' is not a valid attribute for a Play #16778

Closed
saltos opened this issue Jul 21, 2016 · 1 comment
Closed

ERROR! 'debug' is not a valid attribute for a Play #16778

saltos opened this issue Jul 21, 2016 · 1 comment
Labels
bug This issue/PR relates to a bug.

Comments

@saltos
Copy link

saltos commented Jul 21, 2016

ISSUE TYPE
  • Bug Report
ANSIBLE VERSION
ansible 2.1.0.0
CONFIGURATION
$ cat ~/.ansible.cfg 
[defaults]
host_key_checking=False
retry_files_enabled=False
OS / ENVIRONMENT

N/A

SUMMARY

Error "'debug' is not a valid attribute for a Play" for the sample from the documentation.

STEPS TO REPRODUCE

Create sample playbook like in the http://docs.ansible.com/ansible/playbooks_loops.html#looping-over-the-inventory:

- debug: msg={{ item }}
  with_items: "{{ groups['all'] }}"

Run it.

$ ansible-playbook -v -i ./hosts/inventory sample.yml
EXPECTED RESULTS

Message output.

ACTUAL RESULTS
ERROR! 'debug' is not a valid attribute for a Play

The error appears to have been in '/home/lexus/src/ps/stash/sso/sso_install_7.6/sso_install/sso_apps_status.yml': line 1, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- debug: msg={{ item }}
  ^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes.  Always quote template expression brackets when they
start a value. For instance:

    with_items:
      - {{ foo }}

Should be written as:

    with_items:
      - "{{ foo }}"
@jctanner jctanner added bug_report needs_info This issue requires further information. Please answer any outstanding questions. labels Jul 22, 2016
@jctanner
Copy link
Contributor

@saltos the example referenced is just a task. It is not a valid playbook because it is missings a hosts declaration and the module call is not under a tasks section. The error is indicating that you've used the "debug" keyword as an attribute of the play (not a task).

Please reference http://docs.ansible.com/ansible/playbooks_intro.html for writing playbooks.

@jctanner jctanner removed the needs_info This issue requires further information. Please answer any outstanding questions. label Jul 22, 2016
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 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

3 participants