Automation

 View Only
last person joined: yesterday 

Ask questions and share experiences about Apstra, Paragon, and all things network automation.
  • 1.  Ansible for Configuration

    Posted 05-26-2022 11:59
    I am using Ansible to perform some configurations on my Juniper switches.  I am using juniper_junos_config with the option to use set lines to add to the configuration.  One of my lines is a delete, but this will fail if the statement does not exist in the configuration.  Is there a way to make the delete conditional?


  • 2.  RE: Ansible for Configuration

    Posted 05-27-2022 06:02
    Hello,

    try to use ignore_warning: true

    This should solve out your issue.

    Regards,
    HS


    ------------------------------
    HASSAN SALAMA
    ------------------------------



  • 3.  RE: Ansible for Configuration

     
    Posted 05-27-2022 06:03
    The recommended approach for handling a deletion when the configuration might not be present would be to use the parameter ignore_warning.

    https://junos-ansible-modules.readthedocs.io/en/2.0.0/juniper_junos_config.html

    Regards,
    Andy


    ------------------------------
    Andy Sharp
    ------------------------------



  • 4.  RE: Ansible for Configuration

    Posted 05-27-2022 08:48
    Thanks for the replies!  This looks like it will work great.