napalm_validate

Performs deployment validation via napalm.

Parameters

Parameter Required Default Choices Description
data False N/A N/A dict to load into the YANG object
dev_os False N/A N/A OS of the device.
hostname False N/A N/A IP or FQDN of the device you want to connect to.
models True N/A N/A List of models to parse Note - data to connect to the device is not necessary when using YANG models
optional_args False N/A N/A Dictionary of additional arguments passed to underlying driver.
password False N/A N/A Password.
provider False N/A N/A Dictionary which acts as a collection of arguments used to define the characteristics of how to connect to the device. Note - hostname, username, password and dev_os must be defined in either provider or local param Note - local param takes precedence, e.g. hostname is preferred to provider['hostname']
timeout False N/A N/A Time in seconds to wait for the device to respond.
username False N/A N/A Username.
validation_file True N/A N/A YAML Validation file containing resources desired states.

Examples

- name: GET VALIDATION REPORT

  napalm_validate:

    username: "{{ un }}"

    password: "{{ pwd }}"

    hostname: "{{ inventory_hostname }}"

    dev_os: "{{ dev_os }}"

    validation_file: validate.yml



- name: GET VALIDATION REPORT USING PROVIDER

  napalm_validate:

    provider: "{{ ios_provider }}"

    validation_file: validate.yml



# USING YANG

- name: Let's gather state of interfaces

  napalm_parse_yang:

    dev_os: "{{ dev_os }}"

    hostname: "{{ hostname }}"

    username: "{{ username }}"

    password: "{{ password }}"

    mode: "state"

    optional_args:

        port: "{{ port }}"

    models:

        - models.openconfig_interfaces

  register: interfaces



- name: Check all interfaces are up

  napalm_validate:

    data: "{{ interfaces.yang_model }}"

    models:

        - models.openconfig_interfaces

    validation_file: "validate.yaml"

  register: report

Return

Name Description Returned Type Sample
compliance_report validation report obtained via napalm. always dict
changed check to see if a change was made on the device. always bool False