Ansible Collection for managing Palo Alto Networks Strata Cloud Manager (SCM) configurations.
NOTE: This collection is designed to provide infrastructure-as-code capabilities for the Strata Cloud Manager platform, enabling efficient management of folders, labels, snippets, variables, and other SCM resources.
- Features
- Requirements
- Installation
- Available Modules
- Example Usage
- Authentication
- Example Playbooks
- Development
- Contributing
- License
- Author
- Configuration Management: Create, read, update, and delete SCM configuration objects such as folders, labels, snippets, and variables.
- Comprehensive Module Set: Collection includes modules for organizational elements, configuration management, and future support for security objects.
- Idempotent Operations: All modules are designed to be idempotent, ensuring consistent and predictable results.
- Detailed Information Modules: Companion "info" modules for retrieving detailed information about resources.
- OAuth2 Authentication: Securely authenticate with the Strata Cloud Manager API using OAuth2 client credentials.
- Role-Based Automation: Ready-to-use roles for common operational tasks.
- Python 3.11 or higher
- Ansible Core 2.17 or higher
- pan-scm-sdk 0.3.33 or higher (installed automatically as a dependency)
-
Install the collection from Ansible Galaxy:
ansible-galaxy collection install cdot65.scm
-
Or install directly from GitHub:
ansible-galaxy collection install git+https://github.com/cdot65/cdot65.scm.git
-
If you're using Poetry for dependency management:
poetry run ansible-galaxy collection install cdot65.scm
Symbol | Status |
---|---|
β | Complete and available for use |
π | Planned for future release |
Module | Description | Status |
---|---|---|
address | Address object management | β |
address_info | Retrieve address object information | β |
address_group | Address group management | β |
address_group_info | Retrieve address group information | β |
application | Application object management | β |
application_info | Retrieve application object information | β |
application_filter | Application filters management | β |
application_filter_info | Retrieve application filters information | β |
application_group | Application group management | β |
application_group_info | Retrieve application group information | β |
auto_tag_actions | Auto tag actions management | π |
auto_tag_actions_info | Retrieve auto tag actions information | π |
dynamic_user_group | Dynamic user group management | β |
dynamic_user_group_info | Retrieve dynamic user group information | β |
external_dynamic_list | External dynamic lists management | β |
external_dynamic_list_info | Retrieve external dynamic lists information | β |
hip_object | HIP object management | β |
hip_object_info | Retrieve HIP object information | β |
hip_profile | HIP profile management | β |
hip_profile_info | Retrieve HIP profile information | β |
http_server_profile | HTTP server profiles management | β |
http_server_profile_info | Retrieve HTTP server profiles information | β |
log_forwarding_profile | Log forwarding profile management | β |
log_forwarding_profile_info | Retrieve log forwarding profile information | β |
quarantined_devices | Quarantined devices management | β |
quarantined_devices_info | Retrieve quarantined devices information | β |
region | Region object management | β |
region_info | Retrieve region object information | β |
schedules | Schedules management | π |
schedules_info | Retrieve schedules information | π |
service | Service object management | π |
service_info | Retrieve service object information | π |
service_group | Service group management | π |
service_group_info | Retrieve service group information | π |
syslog_server_profiles | Syslog server profiles management | π |
syslog_server_profiles_info | Retrieve syslog server profiles information | π |
tag | Tag management | π |
tag_info | Retrieve tag information | π |
Module | Description | Status |
---|---|---|
ike_crypto_profile | IKE crypto profile management | π |
ike_crypto_profile_info | Retrieve IKE crypto profile information | π |
ike_gateway | IKE gateway management | π |
ike_gateway_info | Retrieve IKE gateway information | π |
ipsec_crypto_profile | IPsec crypto profile management | π |
ipsec_crypto_profile_info | Retrieve IPsec crypto profile information | π |
nat_rules | NAT rules management | π |
nat_rules_info | Retrieve NAT rules information | π |
security_zone | Security zone management | π |
security_zone_info | Retrieve security zone information | π |
Module | Description | Status |
---|---|---|
bandwidth_allocations | Bandwidth allocations management | π |
bandwidth_allocations_info | Retrieve bandwidth allocations information | π |
bgp_routing | BGP routing management | π |
bgp_routing_info | Retrieve BGP routing information | π |
internal_dns_servers | Internal DNS servers management | π |
internal_dns_servers_info | Retrieve internal DNS servers information | π |
network_locations | Network locations management | π |
network_locations_info | Retrieve network locations information | π |
remote_networks | Remote networks management | π |
remote_networks_info | Retrieve remote networks information | π |
service_connections | Service connections management | π |
service_connections_info | Retrieve service connections information | π |
Module | Description | Status |
---|---|---|
anti_spyware_profile | Anti-spyware profile management | π |
anti_spyware_profile_info | Retrieve anti-spyware profile information | π |
decryption_profile | Decryption profile management | π |
decryption_profile_info | Retrieve decryption profile information | π |
dns_security_profile | DNS security profile management | π |
dns_security_profile_info | Retrieve DNS security profile information | π |
security_rule | Security rule management | π |
security_rule_info | Retrieve security rule information | π |
url_categories | URL categories management | π |
url_categories_info | Retrieve URL categories information | π |
vulnerability_protection_profile | Vulnerability protection profile management | π |
vulnerability_protection_profile_info | Retrieve vulnerability protection profile information | π |
wildfire_antivirus_profile | WildFire antivirus profile management | π |
wildfire_antivirus_profile_info | Retrieve WildFire antivirus profile information | π |
Module | Description | Status |
---|---|---|
device | Device management | π |
device_info | Retrieve device information | β |
folder | Folder management | β |
folder_info | Retrieve folder information | β |
label | Label management | β |
label_info | Retrieve label information | β |
snippet | Snippet management | β |
snippet_info | Retrieve snippet information | β |
variable | Variable management | β |
variable_info | Retrieve variable information | β |
Module | Description | Status |
---|---|---|
agent_versions | Agent versions management | π |
agent_versions_info | Retrieve agent versions information | π |
auth_settings | Auth settings management | π |
auth_settings_info | Retrieve auth settings information | π |
Module | Description | Status |
---|---|---|
deployment | Trigger configuration push/deployment | π |
job_info | Check job status | π |
- name: Create parent folder
cdot65.scm.folder:
name: "Network-Objects"
description: "Parent folder for network objects"
parent: "" # Root level folder
scm_access_token: "{{ scm_access_token }}"
register: parent_folder
- name: Create a subfolder
cdot65.scm.folder:
name: "Address-Objects"
description: "Folder for address objects"
parent: "Network-Objects"
scm_access_token: "{{ scm_access_token }}"
- name: Create a network variable
cdot65.scm.variable:
name: "subnet-variable"
folder: "Network-Objects"
value: "10.1.1.0/24"
type: "ip-netmask"
description: "Network subnet for department A"
scm_access_token: "{{ scm_access_token }}"
register: subnet_variable
- name: Get all folders
cdot65.scm.folder_info:
scm_access_token: "{{ scm_access_token }}"
register: all_folders
- name: Get specific folder by name
cdot65.scm.folder_info:
name: "Network-Objects"
scm_access_token: "{{ scm_access_token }}"
register: network_folder
- name: Get VM-series firewalls
cdot65.scm.device_info:
model: "PA-VM"
scm_access_token: "{{ scm_access_token }}"
register: vm_devices
The collection uses OAuth2 authentication with the SCM API. All secrets must be provided via Ansible Vault-encrypted variable files.
- name: Authenticate with SCM
hosts: localhost
gather_facts: no
vars_files:
- vault.yml # Store secrets here (encrypted with Ansible Vault)
roles:
- cdot65.scm.auth
A typical vault.yml
file should contain:
scm_client_id: "your-client-id"
scm_client_secret: "your-client-secret"
scm_tsg_id: "your-tsg-id"
Security Note: Always use Ansible Vault for storing credentials. Environment variables may be used for development only but are not recommended for production.
The collection includes several example playbooks in the examples/
directory:
auth.yml
- Authentication examplefolder.yml
- Create and manage foldersfolder_info.yml
- Retrieve folder informationlabel.yml
- Create and manage labelslabel_info.yml
- Retrieve label informationsnippet.yml
- Create and manage snippetssnippet_info.yml
- Retrieve snippet informationvariable.yml
- Create and manage variablesvariable_info.yml
- Retrieve variable informationdevice_info.yml
- Retrieve device informationaddress.yml
- Create and manage address objectsaddress_info.yml
- Retrieve address informationaddress_group.yml
- Create and manage address groupsaddress_group_info.yml
- Retrieve address group informationapplication.yml
- Create and manage application objectsapplication_info.yml
- Retrieve application informationapplication_group.yml
- Create and manage application groupsapplication_group_info.yml
- Retrieve application group informationapplication_filter.yml
- Create and manage application filtersapplication_filter_info.yml
- Retrieve application filter informationdynamic_user_group.yml
- Create and manage dynamic user groupsdynamic_user_group_info.yml
- Retrieve dynamic user group informationexternal_dynamic_list.yml
- Create and manage external dynamic listsexternal_dynamic_list_info.yml
- Retrieve external dynamic list informationhip_object.yml
- Create and manage host information profile objectship_object_info.yml
- Retrieve host information profile object informationhip_profile.yml
- Create and manage host information profileship_profile_info.yml
- Retrieve host information profile informationhttp_server_profile.yml
- Create and manage HTTP server profileshttp_server_profile_info.yml
- Retrieve HTTP server profile informationlog_forwarding_profile.yml
- Create and manage log forwarding profileslog_forwarding_profile_info.yml
- Retrieve log forwarding profile informationlog_forwarding_profile_minimal.yml
- Minimal example for log forwarding profilesquarantined_devices.yml
- Create and manage quarantined devicesquarantined_devices_info.yml
- Retrieve quarantined device information
This collection is built using poetry for dependency management.
# Setup development environment
make dev-setup
# Build the collection
make build
# Install the collection locally
make install
# Build and install in one step
make all
# Run all linting and formatting checks
make lint-all
# Format code
make format
# Fix linting issues automatically
make lint-fix
# Run all tests
make test
The collection follows consistent design patterns:
- Resource Modules: Perform CRUD operations with idempotent behavior
- Info Modules: Retrieve detailed information with optional filtering
- Standard Parameters: Consistent parameter naming across all modules
- Error Handling: Detailed error reporting with specific error codes
- Check Mode Support: Preview changes without applying them
All modules support:
- Check mode
- Detailed error messages
- Consistent return structures
- Authentication via SCM access token
Contributions are welcome! Please see the CONTRIBUTING.md file for guidelines.
GNU General Public License v3.0 or later
- Calvin Remsburg (@cdot65)