Skip to content

Instantly share code, notes, and snippets.

@nleiva
Created June 16, 2023 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nleiva/4b493c679ee261f0fec13f019994aadb to your computer and use it in GitHub Desktop.
Save nleiva/4b493c679ee261f0fec13f019994aadb to your computer and use it in GitHub Desktop.
Parsing ACLs with a Network Resource Module
- name: Parse ACLs for provided configuration
cisco.asa.asa_acls:
running_config: "{{ lookup('file', config) }}"
state: parsed
ignore_errors: true
register: asa_acls
vars:
ansible_connection: ansible.netcommon.network_cli
ansible_network_os: cisco.asa.asa
- name: Save ACLs config
ansible.builtin.copy:
content: "{{ asa_acls.parsed.acls | default('N/A') | ansible.builtin.to_nice_yaml }}"
dest: /output/asa_acls.cfg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment