Keep getting an error when running the following playbook. Copied from gethub and watch youtube running the same w/o error.
I think the dash needs to align with the t of task
Thanks but I moved like so and now get another error.
tasks:
- name: Pull WWPNs from UCS
getucswwpns:
host={{ inventory_hostname }}
ucs_user=“config”
ucs_pass=“config”
outputfile=output.txt
logfile=log.txt
The offending line appears to be:
- name: Pull WWPNs from UCS
getucswwpns:
^ here
Hi,
All your problems lies to some wrong indentation...
Please read :
http://docs.ansible.com/ansible/latest/YAMLSyntax.html
and
http://docs.ansible.com/ansible/latest/playbooks_roles.html#task-versus-play-includes
in your last error, getucswwpns need to be aligned to name...
Regards,
JYL
I have moved the alignment every way possible it seams. Will continue to read…
There’s also a problem with “:” and “=” If you put arguments on multiple lines you need to use “:” and not “=”… (preferred way for readability) Documentation about it here : If you put arguments on the same line than your module you need to use “=” Regards, JYL
The problem is that you have not shown you complete error message, the part you have is not relevant at all.
If you look at you output is also say something like "the error might be else in the file".
If you had provided the completa error message you probably would had a answer much sooner.
But my guess is that your problem is the hosts: line, remove the parentheses and the text between.
Not sure what you mean my removing the parentheses and text between. Doesn’t that equal blank??
This is my complete yml file>
Not sure what you mean my removing the parentheses and text between.
Doesn't that equal blank??
This is my complete yml file>
---
- name: Get Existing UCS Information
hosts: ucs
connection: local
gather_facts: no
In you initial mail you had this
hosts: ucs (Runs on UCS group in the inv file)
So if you had this in you playbook it would fail and the reason for my
comment.
tasks:
- name: Pull WWPNs from UCS
getucswwpns:
hosts= {{ inventory_hostname }}
ucs_usercwcw="config"
ucs_passcwcw="config"
outputfilecw=output.txt
logfile=log.txtThis is the complete error msg.
ERROR! no action detected in task. This often indicates a misspelled module
name, or incorrect module path.
This is the essential error message, your module getucswwpns doesn't exist.
getucswwpns is not part of Ansible so you would need to install it.
I did not add the getucswwpns module, and good to know it has to be. Thanks for the input.