Automation

 View Only

IMPORTANT MODERATION NOTICE

This community is currently under full moderation, meaning  all posts will be reviewed before appearing in the community. Please expect a brief delay—there is no need to post multiple times. If your post is rejected, you'll receive an email outlining the reason(s). We've implemented full moderation to control spam. Thank you for your patience and participation.



  • 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.