Automation

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.  QFX5200 warning prevent automation to work.

    Posted 07-12-2021 06:25
    Hello,

    We use Ansible and Napalm to automate our configuration process.
    It works well with many devices but we have an issue with QFX5200-48y.

    When we change the channel speed it leads to a "warning". This is the expected behaviour.
    root@5200-1# set system name-server 1.1.1.1
    root@5200-1# show | compare
    warning: 25g config will be applied to ports 0 to 3
    [edit system]
    +  name-server {
    +      1.1.1.1;
    +  }

    Unfortunatly it breaks our automated process (Ansible and Napalm).

    For instance. When trying to deploy a piece of configuration using Ansible we have the following message.

    TASK [Deploy DNS configuration] ***************************************************************************************************************************************************************************
    fatal: [qfx5200-15]: FAILED! => {"changed": false, "msg": "Failure diffing the configuraton: RpcError(severity: warning, bad_element: None, message: warning: 25g config will be applied to ports 0 to 3)"}


    Is there any way to prevent the QFX from warning or to prevent Ansible/Napalm/Netconf from failing after a simple "warning"?

    Thank you for your help
    Best regards

    Vincent



  • 2.  RE: QFX5200 warning prevent automation to work.
    Best Answer

    Posted 07-12-2021 12:34
    Vincent,

    You can set the task to ignore rpc_errors with a warning level by using "ignore_warning: true",  all rpc_error elements with higher severity levels will still raise exceptions.

    You can also set the string, or list of strings, to ignore:
            ignore_warning: 
              - "Advertisement-interval is less than four times"
              - "Chassis configuration for network services has been changed."


    Documentation can be found in the link below:
    https://www.juniper.net/documentation/us/en/software/junos-ansible/ansible/topics/topic-map/junos-ansible-configuration-loading-committing.html


    Example:
    ---
    - name: Configure Device 
      hosts: dc1
      connection: local
      gather_facts: no
    
      tasks:
        - name: Configure op script
          juniper.device.config:
            config_mode: "private"
            load: "set"
            lines:
              - "set system scripts op file bgp.slax"
            ignore_warning: true
          register: response
        - name: Print the response
          debug:
            var: response​
     
    --Ben

    ------------------------------
    Benjamin Griffin
    ------------------------------



  • 3.  RE: QFX5200 warning prevent automation to work.

    Posted 07-13-2021 10:01
    Hi Ben... and thanks a lot.

    It works!

    Thank you for your help.
    Vince