run with -v (or -vvv) to see the output of the task on the command line
use register to further process the output (http://docs.ansible.com/ansible/latest/playbooks_variables.html#registered-variables)
run with -v (or -vvv) to see the output of the task on the command line
use register to further process the output (http://docs.ansible.com/ansible/latest/playbooks_variables.html#registered-variables)
where is your password and username saved? there should be a template for these?
try below… you need to register the output & the use debug to display the stdout of register…
Hi,
I am also facing a similar problem. The output says “register” is not supported for ios_command module. Any idea on this? I am running the latest ansible version 2.4.2.0. If I don’t use the register command, the playbook executes successfully, so the error is only caused by register/stdout related commands.
Appreciate any help.
register is a directive for the task and not the module.
So the register is indented to spaces to much, it should be on the same level as ios_command, delegate_to and name.
Excellent! Many thanks for the pointer and it is working now. Is there any link that you could provide me regarding the best practices for indendations?
You have the YAML specification that says it must be space and you need to be consistent on the number of spaces you use.
For Ansible you have the list[1] that list all directives and where you can use them.
What you can use on the module it self is documented under each module.
So for register, you'll not find that documented under ios_command so you can't have under the module. But if you check the link you'll see that register on can be used on the task.
[1] http://docs.ansible.com/ansible/latest/playbooks_keywords.html
I am getting following error:
fatal: [210.4.64.100]: FAILED! => {
“ansible_facts”: {
“discovered_interpreter_python”: “/usr/bin/python”
},
“changed”: false,
“invocation”: {
“module_args”: {
“command”: “show version”
}
},
“msg”: “Unsupported parameters for (ios_command) module: command Supported parameters include: auth_pass, authorize, commands, host, interval, match, password, port, provider, retries, ssh_keyfile, timeout, username, wait_for”
}
PLAY RECAP *************************************************************************************************************************************************************
210.4.64.100 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
Someone please assist me
I am getting following error:
fatal: [210.4.64.100]: FAILED! => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"invocation": {
"module_args": {
"command": "show version"
}
},
"msg": "Unsupported parameters for (ios_command) module: command Supported parameters include: auth_pass, authorize,
commands, host, interval, match, password, port, provider, retries, ssh_keyfile, timeout, username, wait_for"
}
The error message really points out the mistake in your playbook.
Regards
Racke
Should be "commands" instead of "command", probably?
HTH,
-vlado
Here is my playbook, would you please check ?
Hello Kazi,
The following error indicates that during the execution of ios_command module an unsupported parameter ‘command’ was found. Do check the Ansible document [1] for the support parameters in the ios_command module.