Skip to content

Instantly share code, notes, and snippets.

@IPvSean
Last active July 22, 2020 17:49
Show Gist options
  • Save IPvSean/573b71dc0f783309af6bb9fb1373f6ab to your computer and use it in GitHub Desktop.
Save IPvSean/573b71dc0f783309af6bb9fb1373f6ab to your computer and use it in GitHub Desktop.
- name: remove stale interface config from Ethernet interfaces and turn on udld
connection: local
  template:
src: template.j2
dest: test_render.txt
- name: remove stale interface config from Ethernet interfaces and turn on udld
  ios_config:
src: template.j2
{% for tim_interface in hostvars[inventory_hostname].ansible_net_interfaces %}
interface {{ tim_interface }}
{% if "Vlan" not in tim_interface and "Tunnel" not in tim_interface and "Port" not in tim_interface %}
no spanning-tree portfast
no spanning-tree bpdufilter
udld port
{% endif %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment