{"id":18722400,"url":"https://github.com/nleiva/capirca_acl","last_synced_at":"2025-04-12T14:42:41.824Z","repository":{"id":51490903,"uuid":"271382804","full_name":"nleiva/capirca_acl","owner":"nleiva","description":"This collection includes a module (translate) to use Capirca from your Ansible playbooks.","archived":false,"fork":false,"pushed_at":"2023-12-02T19:10:03.000Z","size":98,"stargazers_count":10,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T07:34:19.750Z","etag":null,"topics":["acl","ansible","ansible-galaxy","ansible-modules","arista","cisco","iptables","juniper","nftables","paloalto","security"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nleiva.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-10T20:51:01.000Z","updated_at":"2024-12-10T15:58:47.000Z","dependencies_parsed_at":"2024-11-07T13:43:21.500Z","dependency_job_id":"5c2da086-aee5-4421-95a1-e37293f17de6","html_url":"https://github.com/nleiva/capirca_acl","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nleiva%2Fcapirca_acl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nleiva%2Fcapirca_acl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nleiva%2Fcapirca_acl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nleiva%2Fcapirca_acl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nleiva","download_url":"https://codeload.github.com/nleiva/capirca_acl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248583379,"owners_count":21128577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acl","ansible","ansible-galaxy","ansible-modules","arista","cisco","iptables","juniper","nftables","paloalto","security"],"created_at":"2024-11-07T13:41:19.243Z","updated_at":"2025-04-12T14:42:41.800Z","avatar_url":"https://github.com/nleiva.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Capirca ACL Collection for Ansible\n\n![CI](https://github.com/nleiva/capirca_acl/workflows/CI/badge.svg)\n\nThis repo hosts an unofficial [Capirca](https://github.com/google/capirca) Ansible Collection.\n\nThis collection includes a module ([translate](docs/translate.md)) to use\n[Capirca](https://github.com/google/capirca) from your Ansible playbooks as well as a lookup\nplugins for resolving symbols into networks and services.\n\n## Included content\n\nClick on the name of a plugin or module to view that content's documentation:\n\n  - **Modules**:\n    - [translate](docs/translate.md)\n  - **Plugins**:\n    - `network`: Lookup network definition.\n    - `service`: Lookup service definition.\n\n## Installation and Usage\n\n### Installing the Collection from Ansible Galaxy\n\nBefore using this collection, you need to install it with the Ansible [Galaxy](https://galaxy.ansible.com/nleiva/capirca_acl) CLI:\n\n    ansible-galaxy collection install nleiva.capirca_acl\n\nYou can also include it in a `requirements.yml` file and install it via `ansible-galaxy collection install -r requirements.yml`, using the format:\n\n```yaml\n---\ncollections:\n  - name: nleiva.capirca_acl\n    version: 0.3.1\n```\n\n### Using modules from the Capirca ACL Collection in your playbooks\n\nYou can either call modules by their Fully Qualified Collection Namespace (FQCN), like `nleiva.capirca_acl.translate`, or you can call modules by their short name if you list the `nleiva.capirca_acl` collection in the playbook's `collections`, like so:\n\n```yaml\n---\n- hosts: localhost\n  gather_facts: no\n  connection: local\n\n  collections:\n    - nleiva.capirca_acl\n\n  tasks:\n    - name: Run this module to generate an ACL\n      translate:\n        platform: 'ciscoxr'\n        filter_options:\n          - ipv6-test-filter\n          - inet6\n        def_folder: \"files/def\"\n        pol_file: \"files/policies/terms.pol\"\n      register: testout\n\n    - name: Dump the resulting ACL\n      debug:\n        msg: '{{ testout.message }}'\n```\n\nSee [translate](docs/translate.md) for more details.\n\n### Using plugins from the Capirca ACL Collection in your playbooks\n\n```yaml\n    - name: Lookup services\n      ansible.builtin.debug:\n        msg:\n          - \"{{ lookup('nleiva.capirca_acl.service', 'HTTP', 'HTTPS', def_folder='tests/integration/targets/translate/files/def') }}\"\n    #  '80/tcp,443/tcp'\n\n  - name: Lookup network\n      ansible.builtin.debug:\n        msg:\n          - \"{{ lookup('nleiva.capirca_acl.network', 'WEB_SERVERS', def_folder='tests/integration/targets/translate/files/def') }}\"\n    # [IPv4('200.1.1.1/32'), IPv4('200.1.1.2/32')]\n```\n\n### Run an example\n\nThe example documented in [translate](docs/translate.md) can be run with:\n\n```bash\nmake example\n```\n\n## Testing and Development\n\n### Testing with `ansible-test`\n\nThe `tests` directory contains configuration for running sanity and integration tests using [`ansible-test`](https://docs.ansible.com/ansible/latest/dev_guide/testing_integration.html).\n\nYou can run the collection's test suites with the command:\n\n```bash\nmake test-remote\n```\n\n### Testing locally with Ansible\n\nYou can run the collection's test suites without [`ansible-test`](https://docs.ansible.com/ansible/latest/dev_guide/testing_integration.html) with the command:\n\n```bash\nmake test-local\n```\n\n## Publishing New Versions\n\nWe first need to make sure the test cases run successfully:\n\n```bash\nmake test-local\n```\n\nThen we need to TAG the version with a version number greater than the latest one:\nAnd finally, build:\n\n```\nmake build\n```\n\nIt will end up on [Capirca Collection](https://galaxy.ansible.com/nleiva/capirca_acl) Galaxy page](https://galaxy.ansible.com/nleiva/capirca_acl) if you have access to the namespace.\n\n## More Information\n\nFor more information about [Capirca](https://github.com/google/capirca), join the `#capirca` channel on [NetworkToCode Slack](https://networktocode.slack.com/), and browse the resources in the [Capirca Wiki](https://github.com/google/capirca/wiki) page.\n\n- [Multi-Platform ACL Generation and Testing](https://rvasec.com/slides/2013/Watson-Capirca.pdf)\n- [Capirca Wiki](https://github.com/google/capirca/wiki)\n\n## License\n\nGNU General Public License v3.0 or later\n\nSee [LICENCE](LICENSE) to see the full text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnleiva%2Fcapirca_acl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnleiva%2Fcapirca_acl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnleiva%2Fcapirca_acl/lists"}