cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1875
Views
3
Helpful
3
Replies

Connecting Recent versions of Ansible to Cisco AireOS WLC

Translator
Community Manager
Community Manager

Hi all.

I am trying to connect Ansible to a WLC running AireOS, but it does not work at all.

It used to work when using

ansible_connection=local

But this is no longer supported in recent versions of ansible.

Using Network CLI does not connect to the WLC.

ansible_connection=network_cli
ansible_network_os=community.network.aireos
ansible_port=22

It doesn't work if I use the provider parameter for credentials.

---
legacy_credentials
:
host: "{{ inventory_hostname }}"
username: "{{ lookup('env', 'USERNAME') }}"
password: "{{ lookup('env', 'PASSWORD') }}"

 

My Playbook:

---
- hosts: all
gather_facts: False
tasks:
- name: Run show sysinfo on remote devices
community.network.aireos_command:
provider: "{{ legacy_credentials }}"
commands: show sysinfo

- name: Ensure we are running the script on a WLC and not other devices
community.network.aireos_command:
provider: "{{ legacy_credentials }}"
commands: show sysinfo
wait_for: result[0] contains 'Cisco Controller'

Just wondering if this is something I am missing

Would anyone have a working example of connecting to an AireOS WLC?

 

ansible —version
ansible [core 2.13.3]
python version = 3.9.6 (default, Mar 10 2023, 20:16:38) [Clang 14.0.3 (clang-1403.0.22.14.1)]
jinja version = 3.0.1
libyaml = False

 

ansible-galaxy collection list | grep network
community.network 4.0.1
f5networks.f5_modules 1.19.0
junipernetworks.junos 3.1.0

3 Replies 3

Rasika Nayanajith
VIP Alumni
VIP Alumni

I do not think AireOS WLCs support any of these automation

HTH
Rasika
*** Pls rate all useful responses ***

Not sure I understand your response. I am having a similar issue. It was stated it worked prior to a newer version of Ansible. I have had many Ansible scripts work with AireOS controllers.

Translator
Community Manager
Community Manager

I managed to fix it by rolling back to an older version of Ansible that accepts connection=local.

This works for me now.

(env):ansible acurunzi$ ansible —version
2.9.27
...
python version = 3.9.6 (default, May 7 2023, 23:32:44) [Clang 14.0.3 (clang-1403.0.22.14.1)]

 

 

Review Cisco Networking for a $25 gift card