8000 junos module fails to load from within a role · Issue #57985 · ansible/ansible · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000
junos module fails to load from within a role #57985
Closed
@ganeshrn

Description

@ganeshrn
SUMMARY

Module statirng with junos_* within a role fails to load with import error

ISSUE TYPE
  • Bug Report
COMPONENT NAME

plugins/action/junos.py

ANSIBLE VERSION
2.9
CONFIGURATION

OS / ENVIRONMENT
STEPS TO REPRODUCE

Create a role with below structure

$tree
.
├── ansible.cfg
├── roles
│   └── network
│       ├── README.md
│       ├── bindep.txt
│       ├── defaults
│       │   └── main.yml
│       ├── handlers
│       │   └── main.yml
│       ├── library
│       │   ├── __init__.py
│       │   ├── __pycache__
│       │   ├── junos_facts.py
│       │   └── junos_interfaces.py
│       ├── meta
│       │   └── main.yml
│       ├── module_utils
│       │   ├── __init__.py
│       │   └── network
│       │       ├── __init__.py
│       │       └── junos
│       │           ├── __init__.py
│       │           ├── argspec
│       │           │   ├── __init__.py
│       │           │   ├── facts
│       │           │   │   ├── __init__.py
│       │           │   │   └── facts.py
│       │           │   └── interfaces
│       │           │       ├── __init__.py
│       │           │       └── interfaces.py
│       │           ├── config
│       │           │   ├── __init__.py
│       │           │   ├── base.py
│       │           │   └── interfaces
│       │           │       ├── __init__.py
│       │           │       └── interfaces.py
│       │           ├── facts
│       │           │   ├── __init__.py
│       │           │   ├── base.py
│       │           │   ├── facts.py
│       │           │   └── interfaces
│       │           │       ├── __init__.py
│       │           │       └── interfaces.py
│       │           └── utils
│       │               ├── __init__.py
│       │               └── utils.py
│       ├── tasks
│       │   └── main.yml
│       ├── test-requirements.txt
│       ├── tests
│       │   ├── inventory
│       │   └── test.yml
│       ├── tox.ini
│       └── vars
│           └── main.yml
└── test_facts.yaml
---
- hosts: junos
  connection: network_cli
  gather_facts: no
  tasks:
  - name: import network role
    import_role:
      name: network

  - name: get interfaces facts
    junos_facts:
      gather_network_resources:
        - interfaces
EXPECTED RESULTS

Should invoke the junos module within role without any error.

ACTUAL RESULTS
$ansible-playbook test_facts.yaml

PLAY [junos] *****************************************************************************************

TASK [get interfaces facts] **************************************************************************
 An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ImportError: No module named facts.facts
fatal: [junos02]: FAILED! => {"msg": "Unexpected failure during module execution.", "stdout": ""}

PLAY RECAP *******************************************************************************************
junos02                    : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0

Metadata

Metadata

Assignees

Labels

affects_2.9This issue/PR affects Ansible v2.9bugThis issue/PR relates to a bug.networkingNetwork categorysupport:networkThis issue/PR relates to code supported by the Ansible Network Team.tracebackThis issue/PR includes a traceback.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0