Search code examples
networkingansibleansible-awxansible-tower

AWX playbook failing with "network os cisco.iosxr.iosxr is not supported"


I have a playbook that works just great locally, when trying to run with AWX I run into an errors that seem to indicate the device type in the task is not supported.

Loading collection ansible.netcommon from /runner/requirements_collections/ansible_collections/ansible/netcommon
Loading callback plugin awx_display of type stdout, v2.0 from /usr/local/lib/python3.8/site-packages/ansible_runner/callbacks/awx_display.py
Skipping callback 'awx_display', as we already have a stdout callback.
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
PLAYBOOK: soft_reset.yml *******************************************************
Positional arguments: soft_reset.yml
verbosity: 4
remote_user: root
connection: smart
timeout: 10
become: True
become_method: sudo
tags: ('all',)
inventory: ('/runner/inventory/hosts',)
extra_vars: ('@/runner/env/extravars',)
forks: 5
1 plays in soft_reset.yml


PLAY [aggs] ****************************************************************
META: ran handlers

TASK [soft reset bgp peers] ****************************************************
task path: /runner/project/soft_reset.yml:5
fatal: [lab-core-blue]: FAILED! => {
    "msg": "network os cisco.iosxr.iosxr is not supported"
}

inventory/hosts.yml

aggs:
  hosts:
    lab-core-blue:
      ansible_host: lab-core-blue.mylab.com
  vars:
    ansible_network_os: cisco.iosxr.iosxr
    ansible_connection: ansible.netcommon.network_cli

soft_reset.yml

- hosts: aggs
  gather_facts: no
  
  tasks:
  - name: soft reset bgp peers
    ansible.netcommon.cli_command:
      command: clear bgp vpnv4 unicast {{item}} soft
    loop:
      - 1.2.3.2
      - 1.2.3.3
      - 1.2.3.4

collections/requirements.yml

---
collections:
- ansible.netcommon

Solution

  • Thanks to @sivel in #ansible irc for the answer!

    I think the AWX EEs only have ansible-core by default, you need cisco.iosxr in that list

    Turns out I needed to add a line to collections/requirements.yml

    ---
    collections:
    - ansible.netcommon
    - cisco.iosxr