Skip to content

ansible-dnac install doesn't copy dnac.py #3

@jandiorio

Description

@jandiorio

Context

Currently, the install playbook doesn't place the httpapi plugin into a location where Ansible can find it.

Process

  1. Run the collection installation
  2. attempt to consume the collection

Expected Result

Testing of the collection would succeed

Current Result

root@b6498371d394:/development/ansible-dnac/playbooks# ansible-playbook -i hosts.yml test_facts.yml 

PLAY [Testing ansible-dnac Collection] ***********************************************************************************************************

TASK [get devices] *******************************************************************************************************************************
fatal: [dnac-prod.campus.wwtatc.local]: FAILED! => {"msg": "unable to load API plugin for network_os dnac"}

PLAY RECAP ***************************************************************************************************************************************
dnac-prod.campus.wwtatc.local : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   

Possible Fix

Update the existing installer/install.yaml with:

    - name: validate path exists 
      file:
        path: "{{ item }}"
        state: directory 
      loop:  "{{ lookup('config', 'DEFAULT_HTTPAPI_PLUGIN_PATH') }}"  

    - name: link the dnac.py to the plugins/httpapi folder
      file:
        src:  "{{ playbook_dir }}/plugins/httpapi/dnac.py"
        path: "{{ item }}/dnac.py"
        state: link
      loop: "{{ lookup('config', 'DEFAULT_HTTPAPI_PLUGIN_PATH') }}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions