11-20-2023 11:08 PM
Hi Guys I am pushing the following config to the cisco routers, thera re about 500 of them, but script is getting failed/
---
- name: Create ACL
hosts: routers
gather_facts: false
connection: local
vars:
cli:
username: "{{ hdn_user_rw }}"
password: "{{ hdn_pass_rw }}"
tasks:
- name: Push config
ios_config:
provider: "{{ cli }}"
authorize: yes
lines:
- permit 10.253.68.64 0.0.0.62
Parents: ip access-list standard TEST
before: no ip access-list standard TEST
match: none
Error message that I get is
Unsupported parameters for (ios_config) module: Parents Supported parameters include: after,auth_pass,authorize,backup,before,defaults,diff_against,diff_ignore_lines,force,host,intended_config,lines,match,multiline_delimiter,parents,password,port,provider,replace,running_config,save,save_when,src,ssh_keyfile,timeout,username
to retry, use: --limit @/opt/ansible/dev/Dheeraj/Splunk3.retry
PLAY RECAP *****************************************************************************************************************************************************************************************************************************************************
WAGGJLC-NRT001 : ok=0 changed=0 unreachable=0 failed=1
[htech@virtapp-sis002 Dheeraj]$
Appreciate if could help
11-21-2023 12:10 AM
what ansible version you using, check from the Linux first you able to connect normally using SSH command to confirm is the device reachable and working.
I used below example to test single device when i was testing my Lab it works as expected : (what kind of router and model you using, do you see any logs on the router while ansible connecting time ?)
https://docs.ansible.com/archive/ansible/2.5/modules/ios_config_module.html
11-21-2023 01:43 AM
@dheerajoz30 based on the error you see, i would indicate that the parents parameter is not supported by the ios_config module. The parameter is used to specify the parent configuration section where the changes should be applied. From what i recall, the ios_config module only supports applying changes to the global configuration section. https://docs.ansible.com/ansible/latest/collections/cisco/ios/ios_config_module.html
To fix this issue, you can remove the parents parameter from the task. The changes should then be applied to the global configuration section, which should resolve error issue you see.
Hope this helps.
11-21-2023 04:29 AM
@dheerajoz30 also check your inventory, it should look something like this:
routers:
hosts:
router1.xyz.com:
router2.xyz.com:
vars:
ansible_connection: ansible.netcommon.network_cli
ansible_network_os: cisco.ios.ios
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide