Created
June 16, 2023 17:37
-
-
Save nleiva/4b493c679ee261f0fec13f019994aadb to your computer and use it in GitHub Desktop.
Parsing ACLs with a Network Resource Module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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