Hello
I do use Ansible 2.4 to manage 300 cisco switches.
4 ansible connections are stuck at every run.
USER %CPU %MEM STAT START TIME COMMAND
me 99.5 0.1 R 12:01 223:06 /usr/bin/python /usr/bin/ansible-connection
me 99.4 0.1 R 12:01 222:47 /usr/bin/python /usr/bin/ansible-connection
me 99.6 0.1 R 12:07 217:17 /usr/bin/python /usr/bin/ansible-connection
me 99.5 0.1 R 12:07 217:09 /usr/bin/python /usr/bin/ansible-connection
The ansible log tells me which hosts are causing the problem but none is said about the reason that keeps the ansible-connection up and why it takes 100% CPU.
Any idea ?
The playbooks are just a sequence of ios_command tasks followed by a serialization of the results.
---
- hosts: cisco-ios-l2
gather_facts: no
connection: local
vars:
ios_provider:
username: "{{ un }}"
password: "{{ pwd }}"
host: "{{ inventory_hostname }}"
tasks:
- name: RUN analyse on IOS
ios_command:
provider: "{{ ios_provider }}"
commands:
- show interface status
- show vlan
- show mac address-table
- show ip interface brief
- show ip arp
timeout: 30
register: zeResults
- name: save interface status
copy:
content: "{{ zeResults.stdout[0] }}"
dest: vital/interfaces/{{ inventory_hostname }}.interfaces
- name: save vlans
copy:
content: "{{ zeResults.stdout[1] }}"
dest: vital/vlan/{{ inventory_hostname }}.vlan
- name: save mac address-table
copy:
content: "{{ zeResults.stdout[2] }}"
dest: vital/fdb/{{ inventory_hostname }}.fdb
- name: save ip interface brief
copy:
content: "{{ zeResults.stdout[3] }}"
dest: vital/ip/{{ inventory_hostname }}.ip
- name: save arp
copy:
content: "{{ zeResults.stdout[4] }}"
dest: vital/arp/{{ inventory_hostname }}.arp
What should I do to avoid that situation ?
Thanks to the wonderfull Ansible community
William