Closed jwoogee closed 5 years ago
@jwoogee Hi, your playbook is not explicit enough to understand what module you are using. Will you please add the information? We do have docs how to use the parsers https://github.com/ansible-network/network-engine/tree/devel/docs/user_guide
textfsm_parser
needs an argument called name
to have ansible_facts generated https://github.com/ansible-network/network-engine/blob/devel/docs/user_guide/textfsm_parser.md#sample-playbooks
sorry, I’m using the ansible-network.cisco-ios role to attempt this. Maybe this needs to be posed on a different github page? I do understand how to call textfsm directly, but with the get_fact section of the Cisco iOS role it gives the option to use different parser templates to fine tune what facts you get, but it doesn’t explain how to use textfsm in this way, although they say you can.
Thank you,
On Wed, Nov 21, 2018 at 10:02 PM Trishna Guha notifications@github.com wrote:
@jwoogee https://github.com/jwoogee what module are you using? textfsm_parser needs an argument called name to have ansible_facts generated https://github.com/ansible-network/network-engine/blob/devel/docs/user_guide/textfsm_parser.md#sample-playbooks
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ansible-network/network-engine/issues/200#issuecomment-440906244, or mute the thread https://github.com/notifications/unsubscribe-auth/AZrdK-z-3FS7YGqtoLigRP1vEV4m6IyLks5uxiHGgaJpZM4Ytr2Q .
-- Jonathon Woods
I found the issue, the ansible-network.cisco_ios role doesn't have a spot to use name for textfsm templates, and the cli module in ansible-network.network-engine doesn't take name and use it either, so as far as I can see you can't use textfsm in the way the ciso_ios role expects. I can submit a PR with my changes that made it work for me.
Thanks for the details. This needs to be fixed in cli
action plugin instead. I will open a PR when the fix is ready.
Thanks! I created a PR for what works for me, and in Network-engine, that was editing the cli action plugin. It’s PR #202.
On Fri, Nov 23, 2018 at 11:05 PM Trishna Guha notifications@github.com wrote:
Thanks for the details. This needs to be fixed in cli action plugin instead. I will open a PR when the fix is ready.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ansible-network/network-engine/issues/200#issuecomment-441344112, or mute the thread https://github.com/notifications/unsubscribe-auth/AZrdK1KMdQ7QXrKOvXvcc0vO4Qj64-x8ks5uyNN9gaJpZM4Ytr2Q .
-- Jonathon Woods
ISSUE TYPE
ANSIBLE VERSION
Network OS
SUMMARY
I'm trying to use a textfsm template with network-engine to populate ansible_facts. I cannot find documentation how to supply the fact name to supply, and the facts are not showing in ansible_facts.
I added show_interfaces_status.template to parser_templates/cli folder. I'm just not sure how to register that json dictionary now.
STEPS TO REPRODUCE
EXPECTED RESULTS
I expect ansible facts to be populated.
ACTUAL RESULTS
command runs without issue, but ansible_facts aren't updated. It's pretty clear I'm not setting the facts through the course of this, but I don't know how I'm supposed to using textfsm vs command_parser.