Skip to main content
  1. Posts/

Reboot Accesspoints with Ansible

·160 words·1 min·
netdevops blog ansible cisco
Maximilian Thoma
Author
Maximilian Thoma
network engineer

Sometimes it is necessary to reboot the accesspoints and if you don`t want to do it by hand let Ansible work for you :-)

The playbook collects ansible_facts and loop over the interfaces to find ports with the platform description “AIR-” in the CDP neighbors and execute the command “power inline never” afterwards it loops again over the interfaces and makes an “no power inline never”.

You can also use it for other devices like Cisco phones etc.

!! DO NOT STOP THE SCRIPT, IF YOU DO THAT YOU MUST ENABLE THE POWER OF THE INTERFACES MANUALLY


---
- hosts: devices
  connection: network_cli
  gather_facts: True
 
  tasks:
 
  - name: Disable power of AP interface
    ios_config:
      lines:
        - power inline never
      parents: interface {{ item.key }}
    with_dict: "{{ ansible_facts.net_neighbors }}"
    when: '"AIR-" in item.value[0].platform'
 
  - name: Enable power of AP interface
    ios_config:
      lines:
        - no power inline never
      parents: interface {{ item.key }}
    with_dict: "{{ ansible_facts.net_neighbors }}"
    when: '"AIR-" in item.value[0].platform'
```

Related

High load on ASA-5500-X Series with Anyconnect DTLS
·604 words·3 mins
troubleshooting blog cisco asa anyconnect vpn
I identified 3 problems at a ASA setup which is used as VPN concentrator for Anyconnect DTLS VPN clients.
Check_MK: Use API on Check_MK 2.x to trigger tabula rasa for hosts
·166 words·1 min
blog python api check_mk
Sometimes if you must reinventory a huge amount of devices in Check_MK 2.
ProxySG DNS misconfiguration leads to performance issue in forwarding
·490 words·3 mins
troubleshooting blog dns proxysg
If you are using ProxySGs in chains like an internal proxy and an internet facing proxy you must configure a rule on the internal proxy when he should forward traffic to the upstram proxy towards the internet.