QuestionQ242

Infrastructure and Automation

Drag the code from the bottom into the missing boxes in the Ansible script to retrieve the existing Cisco Meraki firewall rules and store the results in a new variable. Not every option is used.

Drag & Drop
rules
register
policy
rules.data
delegate_to
task
access_rule
- name: Get firewall rules
  meraki_mx_l3_firewall:
    auth_key: KEY123
    org_name: example_org
    net_name: example_net
    state: query
  : localhost
  : rules
- set_fact:
    original_ruleset: '{{  }}'
Explanation

delegate_to: localhost executes the Meraki API task from the control host. register: rules captures the module result, and the module exposes the queried firewall rules in its data return field; rules.data therefore supplies the value for original_ruleset.

Learn more

Community Discussion

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