ansible-network / network-engine

This role provides the foundation for building network roles by providing modules and plugins that are common to all Ansible Network roles.
GNU General Public License v3.0
112 stars 53 forks source link

command_parser failed to load tasks #229

Closed alanzdunic closed 5 years ago

alanzdunic commented 5 years ago

ISSUE TYPE

ANSIBLE VERSION

ansible 2.7.8
ansible tower 3.4.1
ansible-network.network-engine 2.7.4

Network OS

N/A

SUMMARY

Currently in command_parser.py after source path is constructed tasks are still loaded from src [tasks = self._loader.load_from_file(src)], but with recent changes I think tasks should now load from src_path [tasks = self._loader.load_from_file(src_path)]

STEPS TO REPRODUCE

- name: parse the show run vrf output
command_parser:
  file: "filename.yml"
  content: "{{output.stdout[0]}}"

EXPECTED RESULTS

Command_parser finishes parsing successfully

ACTUAL RESULTS

on ansible tower playbook fails with

fatal: [XXXXXXXX]: FAILED! => {"msg": "Unable to retrieve file contents\nCould not find or access '/var/lib/awx/projects/_project_name/filename.yml' on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote_src option"}
trishnaguha commented 5 years ago

@alanzdunic Will you be able to test the PR https://github.com/ansible-network/network-engine/pull/230?

To test it:

git clone -b fix_command_parser_file_load --single-branch https://github.com/trishnaguha/network-engine.git

In your playbook change the imported role ansible-network.network-engine to the path of the network engine repository cloned <path>/network-engine.

Note this is development branch.

alanzdunic commented 5 years ago

Test was successful.

Thanks Trishna,

trishnaguha commented 5 years ago

Thanks for the bug report. resolved_by_pr https://github.com/ansible-network/network-engine/pull/230