Closed crazzy closed 6 years ago
cc @privateip @rcarrillocruz click here for bot help
@crazzy
After I replace list_of_lines
in playbook with config commands as below, it runs without any issue.
tasks:
- name: Configure NTP
ios_config:
lines:
- no ip prefix-list isp1-out
- ip prefix-list isp1-out seq 5 permit 1.0.0.0/24
- ip prefix-list isp1-out seq 10 permit 2.0.0.0/23
- no ip prefix-list isp2-out
- ip prefix-list isp2-out seq 5 permit 1.0.0.0/24
- ip prefix-list isp2-out seq 10 permit 2.0.0.0/23
Hence I suspect logic to create list_of_lines
is not correct.
Can you please verify this by printing the list_of_lines
variable in your playbook before running ios_config
task using debug
.
- debug:
name: display list of line
var: list_of_lines
needs_info
cc @Qalthos @gundalow @trishnaguha click here for bot help
cc @kedarX click here for bot help
Closing as we believe this is fixed. If this isn't the case please reopen this issue.
ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
CONFIGURATION
Needed these for the module to even connect to the router:
OS / ENVIRONMENT
Working on a fresh Ubuntu 16.04 trying to use ansible to manage a Cisco C6880-X running c6880x-adventerprisek9-mz.SPA.152-1.SY.bin
SUMMARY
The problem is that ios_config seems to be broken and insert garbage characters or something else that makes the commands not run properly on the router. I am certain it's a bug in ios_config as I have tested the same commands (plus the conf t) using ios_command module, although I had to remove the check for lines beginning with conf in that module.
STEPS TO REPRODUCE
I have a very small playbook, which uses bgpq3 to generate cisco-style prefix-lists based upon data in the RIPE database. I have verified that many times, and the commands are ok, those are not the problem.
So right before the last task in the playbook you will have a list of commands looking like this:
That is correct and working commands that can be pasted right into any Cisco box. However it's not working through ios_config module.
EXPECTED RESULTS
I expected the commands to be run successfully and an OK being reported back.
ACTUAL RESULTS
You can switch module to ios_command and just prepend the lines with "conf t" and append "exit" and "wr" and it will work flawlessly. I do however not want to have to do my own edits of modules to make them work (as I have to remove the check for conf t from ios_command, why is that even there?).