Figured it out. Connection to be used is network_cli and not netconf for this module.
On Fri, Oct 16, 2020 at 4:41 PM AK <[email protected]> wrote: > Hi Folks, I am trying to display output for junos command “show > configuration | compare rollback 1” through ansible however every time I > store the data, I see the whole config output. Any ideas? > > Is there another way to get the previously commited data using rollbacks? > I am using the new role "junipernetworks.junos.junos" so im not find a way > to come up with a way for this. Previous role junos_config had a way but > modules have now changed. > *Playbook* > --- > - name: Playbook to check last commit > hosts: net-junos > connection: netconf > gather_facts: no > roles: > - junipernetworks.junos > > tasks: > - name: Check last commit config > junipernetworks.junos.junos_command: > commands: "show configuration | compare rollback 1" > register: result > > - name: Display Output > debug: > var: result.stdout_lines > > *Output* > > [junos]$ ansible-playbook -i inventory/lab/hosts.ini > 19_show_compare_rollback.yml > > PLAY [Playbook to configure IP Fabric] > ***************************************************************** > > TASK [Check last commit config] > ************************************************************************ > ok: [fw-1] > > TASK [Display Output] > ********************************************************************************** > ok: [fw-1] => { > "result.stdout_lines": [ > [ > "## Last changed: 2020-10-15 16:12:14 UTC", > "version 20190606.224121_builder.r1033375;", > "system {", > " host-name net-junos;", > " root-authentication {", > " encrypted-password \"redacted";", > " }", > " login {", > > ......... (redacted) > > "routing-instances {", > " test {", > " instance-type virtual-router;", > " routing-options {", > " graceful-restart;", > " }", > " interface reth2.10;", > " interface reth2.20;", > " }", > "}" > ] > ] > } > > PLAY RECAP > ********************************************************************************************* > net-junos : ok=2 changed=0 unreachable=0 > failed=0 skipped=0 rescued=0 ignored=0 > > -- > You received this message because you are subscribed to a topic in the > Google Groups "Ansible Project" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/ansible-project/0NgL1JgfUS0/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/ead6dced-03d7-4d21-82dd-70916d5b6017n%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/ead6dced-03d7-4d21-82dd-70916d5b6017n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Arvind Konar Network Engineer Plenty of Fish [email protected] www.plentyoffish.com [image: twitter] [image: linkedin] <https://www.linkedin.com/company/plentyoffish> [image: instagram] STRICTLY PERSONAL AND CONFIDENTIAL. This email and any files transmitted with it may contain confidential and proprietary material for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you are not the intended recipient please contact the sender and delete all copies. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CALkiHsN3gYRG0pHJgbAAP-FMdy1nAR_0Tbhb4EOyoJeegpxxNQ%40mail.gmail.com.
