Ich habe jetzt mal angefangen kleine Snippets / Playbooks in einem Github Repo zu sammeln.
lanbugs/cisco_ansible_playbooks: Ansible playbooks collection for Cisco network devices (github.com)
Freue mich auf Feedback und viel Spaß damit
Beispiel „Interface Description setzen bei Interfaces wo ein Access Point angeschlossen ist“:
--- # Apply description to interfaces where in CDP neighbor an AP is detected - hosts: all gather_facts: True vars: cli: host: "{{ ansible_host }}" username: "{{ ansible_user }}" password: "{{ ansible_ssh_pass }}" ansible_ssh_common_args: -o StrictHostKeyChecking=no tasks: - name: Set description to interface ios_config: lines: - description Access Point parents: 'interface {{ item.key }}' save_when: modified with_dict: "{{ ansible_facts.net_neighbors }}" when: '"AIR-" in item.value[0].platform'