QuestionQ91

VerifiedController-Based Network Automation

An engineer must add a network access device in Cisco ISE to authorize switch RADIUS access. The engineer must POST a network-device resource through ERS with an IP/mask and shared secret. Drag the code snippets into the boxes to construct the artifact. Not all options are used.

Drag & Drop
---
- name: Create ISE Network Device (NAD)
  hosts: localhost
  gather_facts: false
  vars:
    base: "https://198.51.100.200"
    user: "iseadmin"
    pass: "Cisco12345"
  tasks:
    - name: POST networkdevice
      :
        url: "{{base}}/ers/config/networkdevice"
        : POST
        user: "{{user}}"
        password: "{{pass}}"
        force_basic_auth: true
        : json
        body:
          NetworkDevice:
            name: "C9300-BR1"
            description: "Branch switch"
            ipaddresses: [ { ipaddress: "192.0.2.11", mask: "32" } ]
            radiusSettings: { enableKeyWrap: false, radiusSharedSecret: "CiscoRadius" }
        : 201
  validate_certs: false
Explanation

The Ansible uri module interacts with HTTP/HTTPS web services. method specifies the HTTP verb, body_format: json encodes a structured request body as JSON, and status_code specifies which HTTP response codes are treated as successful; an HTTP POST that creates a resource returns 201 Created.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!