12-26-2023 11:48 AM
Hello
I tried the following Ansible playbook, the goal is to change the ip helper address of an existing vlan interface.
And I am receiving the following error:
TASK [Changing IP Helper Address] **************************************************************************************************************
fatal: [switch.com]: FAILED! => {"changed": false, "module_stderr": "interface \"vlan10\"\r\ninterface \"vlan10\"\r\n ^\r\n% Invalid input detected at '^' marker.\r\n\r\nmtlab-c4500(config)#", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"}
PLAY RECAP **************************************************************************************************************
switch.com: ok=2 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=
Playbook:
12-26-2023 12:11 PM
If you looking to change the VLAN 10 IP helper address : i use below code that works for me :
https://pynet.twb-tech.com/blog/using-ansible-to-configure-DHCP-helpers.html
or you looking validate before changing ?
12-26-2023 12:22 PM
Hello @Netmart
Instead of using the parents parameter with the interface keyword, you should directly specify the interface in the command itself.
- name: "Changing IP Helper Address"
ios_config:
lines:
- no ip helper-address 10.0.0.1
- ip helper-address 10.0.0.2
parents: interface "{{vlan_interface_config}}"
become: true
register: output2
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