Skip to content

AlexAsplund/ansible-collections-cribl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Cribl Ansible Collections

License: MIT Ansible Python Tests

πŸ“¦ Latest Release

Current Version: v4.18.2 | Released: | Download

Generated from Cribl API Spec 4.18.2


Module Generator

Auto-generate all Ansible modules from Cribl's OpenAPI specification:

# Generate all modules (imperative + declarative)
python scripts/generate_modules.py --declarative

# Clean and regenerate
python scripts/generate_modules.py --clean

# Specific collection only
python scripts/generate_modules.py --product core

# Use custom OpenAPI spec
python scripts/generate_modules.py --spec path/to/cribl-api.yml

Features:

  • Automatic parameter extraction from OpenAPI schemas
  • Smart categorization (routes to correct product collection)
  • Documentation generation (DOCUMENTATION, EXAMPLES, RETURN blocks)
  • Type conversion (OpenAPI types β†’ Ansible types)
  • Built-in error handling and authentication

Documentation: See docs/GENERATOR.md for advanced usage.


Security

SSL Certificates

# Development (self-signed certs)
validate_certs: false

# Production (valid certs)
validate_certs: true

Secure Credentials with Ansible Vault

# Create encrypted vault
ansible-vault create vault.yml

# Add your credentials
cribl_username: admin
cribl_password: your-secure-password
cribl_token: your-api-token

# Use in playbooks
ansible-playbook playbook.yml -e @vault.yml --ask-vault-pass

Environment Variables

vars:
  cribl_url: "{{ lookup('env', 'CRIBL_URL') }}"
  cribl_token: "{{ lookup('env', 'CRIBL_TOKEN') }}"

Documentation


Project Structure

.
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ generate_modules.py              # CLI entry point
β”‚   └── generator/                       # Modular generator
β”‚       β”œβ”€β”€ openapi_parser.py            # Parse OpenAPI specs
β”‚       β”œβ”€β”€ module_generator.py          # Generate imperative modules
β”‚       β”œβ”€β”€ declarative_generator.py     # Generate declarative modules
β”‚       β”œβ”€β”€ collection_manager.py        # Manage collection structure
β”‚       └── templates.py                 # Code templates
β”œβ”€β”€ schemas/
β”‚   └── cribl-apidocs-4.15.0.yml        # OpenAPI specification
β”œβ”€β”€ build/
β”‚   └── ansible_collections/cribl/       # Generated collections
β”‚       β”œβ”€β”€ core/                        # 276 modules
β”‚       β”œβ”€β”€ stream/                      # 127 modules
β”‚       β”œβ”€β”€ edge/                        # 19 modules
β”‚       β”œβ”€β”€ search/                      # 80 modules
β”‚       └── lake/                        # 11 modules
β”œβ”€β”€ docs/                                # Documentation
β”œβ”€β”€ tests/                               # Test suite
β”‚   β”œβ”€β”€ docker/                          # Docker integration tests
β”‚   β”œβ”€β”€ unit/                            # Unit tests
β”‚   └── integration/                     # Integration tests
β”œβ”€β”€ Makefile                             # Development commands
└── README.md                            # This file

Requirements

  • Python: 3.6 or higher
  • Ansible: 2.9 or higher
  • PyYAML: For OpenAPI parsing
  • Docker: For integration tests (optional)
  • Cribl Instance: Stream, Edge, Search, or Lake

Contributing

Contributions welcome! Please see CONTRIBUTING.md for:

  • Code style guidelines
  • Testing requirements
  • Pull request process
  • Development setup

Support


License

This project is licensed under the MIT License - see the LICENSE file for details.


Roadmap

  • 513 imperative modules (all Cribl API endpoints)
  • Automatic CRUD detection and declarative module generation
  • 49 auto-generated declarative modules across all collections
  • Auto-generated unit tests and integration playbooks
  • Docker integration testing
  • Check mode and diff support
  • Cribl Cloud Support
  • Smart declarative functions targeting worker groups

Acknowledgments

About

Ansible collections for cribl automatically generated from their OpenAPI specification

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors