04-25-2023 10:47 AM - edited 07-28-2023 08:05 AM
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
06-03-2023 02:44 PM
I do not think AireOS WLCs support any of these automation
HTH
Rasika
*** Pls rate all useful responses ***
07-28-2023 07:37 AM
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.
07-28-2023 07:59 AM - edited 07-28-2023 08:04 AM
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)]
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide