Skip to content

feat: introduce modular extension system and refactor network discovery#64

Merged
l50 merged 7 commits into
mainfrom
refactor/idiomatic-ansible-extensions
Apr 2, 2026
Merged

feat: introduce modular extension system and refactor network discovery#64
l50 merged 7 commits into
mainfrom
refactor/idiomatic-ansible-extensions

Conversation

@l50
Copy link
Copy Markdown
Contributor

@l50 l50 commented Apr 2, 2026

Key Changes:

  • Added CLI support for listing and provisioning lab extensions (ELK, Exchange, Guacamole, etc.)
  • Refactored network discovery to use a dedicated network_discovery role and playbook
  • Replaced legacy data.yml approach with an automatic lab config vars plugin
  • Modularized extension playbooks and inventories for easier provisioning and maintenance

Added:

  • Extension CLI commands (dreadgoad extension list, provision, provision-all) for managing extensions
  • New playbooks for extensions: ext-elk.yml, ext-exchange.yml, ext-guacamole.yml, ext-lx01.yml, ext-wazuh.yml, ext-ws01.yml
  • Roles for extension scaffolding and core features (e.g., linux_guacamole, add_dns_record, wazuh_manager)
  • network_setup.yml playbook and network_discovery role for robust network fact gathering
  • Ansible vars plugin (lab_config.py) to auto-load lab JSON configs for all hosts
  • dreadgoad.yaml sample config and improved extension metadata in config
  • Documentation for extension structure and FQDNs

Changed:

  • Refactored main playbook flow to use network_setup.yml for network fact gathering
  • All legacy data.yml imports removed from playbooks; lab config is now injected by the vars plugin
  • Extension inventories and provider configs moved to /extensions/<name>/ and referenced via new config methods
  • CLI config and code updated to support dynamic extension listing, compatibility checking, and data dir resolution
  • Ansible runner and retry logic updated for modular inventory and extra vars per extension
  • Improved error handling and consistent config initialization in CLI commands

Removed:

  • Legacy ansible/extensions and related extension playbooks, roles, and inventories from the main playbook tree
  • All explicit data.yml imports and related ad-hoc fact setting logic from playbooks
  • Redundant or outdated extension and role definitions now replaced by modular system

l50 added 3 commits April 2, 2026 10:38
**Added:**

- Extension playbooks for modular provisioning:
  - `ext-elk.yml` for ELK stack deployment
  - `ext-exchange.yml` for Microsoft Exchange
  - `ext-guacamole.yml` for Apache Guacamole remote access
  - `ext-lx01.yml` for Linux domain enrollment
  - `ext-wazuh.yml` for Wazuh manager/agents
  - `ext-ws01.yml` for hardened workstation
- Role stubs for new server features:
  - `add_dns_record`, `exchange_bot`, `linux_add_linux_to_domain`,
    `linux_guacamole`, `linux_guacamole_create_connections`,
    `linux_tomcat`, `network_discovery`, `wazuh_agent_linux`
- Playbook `network_setup.yml` for runtime network detection and mapping
- Vars plugin `lab_config.py` for automatic lab config injection
- Role `network_discovery` to replace inline network fact gathering
- Role documentation READMEs for new and stub roles
- DRACARYS lab files, configs, and assets for new challenge environment
- CLI extension management commands (`extension.go`) for listing and
  provisioning extensions
- Extension inventories, provider configs, and data directories for
  ELK, Exchange, Guacamole, Wazuh, lx01, and ws01
- Example FQDN documentation (`docs/FQDNs.md`)

**Changed:**

- Playbooks now rely on `lab_config` plugin for loading lab config,
  removing redundant `data.yml` include pattern
- All extension Ansible content moved to `extensions/` directory
- ELK and Wazuh extension roles and data refactored out of core tree
- Improved idempotency and Ansible role naming conventions in playbooks
- Updated main playbook workflow to use `network_setup.yml` for
  network discovery
- `.pre-commit-config.yaml` and `.hooks/linters/ansible-lint.yaml`
  exclude extension and network setup playbooks from linting
- `requirements.yml` updated to include new role dependencies
- Documentation and diagrams updated to reflect new roles/playbooks
- `galaxy.yml` updated to ignore `extensions` directory in builds

**Removed:**

- Legacy extension playbooks and roles from `ansible/extensions`
- Old `data.yml` and inline network detection logic from playbooks
- Deprecated extension inventories and role tasks now modularized
  under `extensions/`
- ELK, Exchange, Wazuh, and ws01 extension content from main tree
  (now in extension modules)
**Added:**

- Introduced `.github/workflows/goreleaser.yaml` for automated GoReleaser-based
  release workflow on tag push
- Added `.goreleaser.yaml` to configure multi-arch builds, ldflags, and prebuild
  hooks for the CLI binary
- Added `SetVersionInfo` function to set CLI version info from ldflags at build
  time

**Changed:**

- Updated all CLI command files to handle errors returned from `config.Get()`
  and propagate them instead of panicking or ignoring
- Improved config initialization: `config.Init()` now returns errors and
  handles missing or invalid config files robustly
- Refactored `findProjectRoot`, `AnsibleEnv`, and related config functions to
  return errors instead of using fallback or silent failure
- Updated ansible runner and retry logic to handle errors from config and
  ansible environment generation, improving reliability and diagnostics
- Modified root command initialization to ensure config is initialized and
  validated before command execution; improved viper flag binding with error
  checking
- Updated tests to handle new error returns from `AnsibleEnv` and
  `findProjectRoot`
- Changed playbook order assertion in tests to expect `network_setup.yml` as
  the first default playbook

**Removed:**

- Eliminated silent error ignoring in config loading and project root
  discovery, making failures explicit
feat: add initial dreadgoad CLI configuration file


**Added:**

- Introduced `dreadgoad.yaml` with settings for environment, retries, timeouts,
  and per-environment variant configuration for the DreadGOAD CLI
@dreadnode-renovate-bot dreadnode-renovate-bot Bot added area/github Changes made to github actions area/playbooks Changes made to playbooks directory area/pre-commit Changes made to pre-commit hooks area/extensions Changes made to extensions (ELK, Exchange, Wazuh, etc.) area/ad-labs Changes made to AD lab definitions area/roles Changes made to Ansible roles area/docs Changes made to documentation labels Apr 2, 2026
…ogic

**Changed:**

- Updated `GoadPath` methods to align with new extension file structure,
  moving Ansible-related files to `ansible/playbooks/{templates,files}/extensions`
  and provider configs to top-level `providers/`
- Refactored extension inventory/template/data/config path resolution to match
  the new structure in `goadpath.py`
- Adjusted provider path methods to locate provider configs under `providers/`
- Modified `LabInstance` extension inventory rendering to use new Jinja template
  locations and file names
- Updated extension discovery in `Lab` to iterate through
  `ansible/playbooks/files/extensions` for available extensions

**Removed:**

- Deleted all extension folders and files from `extensions/`, including
  ELK, Exchange, Guacamole, LX01, Wazuh, and WS01, as part of the migration to
  the new Ansible-centric directory layout
@dreadnode-renovate-bot dreadnode-renovate-bot Bot added the area/python Changes made to Python application code label Apr 2, 2026
l50 added 3 commits April 2, 2026 12:20
…file paths

**Added:**

- Introduced inventory templates for extensions (elk, exchange, guacamole, lx01,
  wazuh, ws01) in `ansible/playbooks/templates/extensions/`
- Added extension configuration files for exchange, lx01, ws01 in
  `ansible/playbooks/files/extensions/`
- Added Guacamole configuration file `guacamole.yml` for extension deployment

**Changed:**

- Updated labeler rules to match new extension template/data locations and
  provider directory structure
- Refactored extension-related path functions in config to use new Ansible
  collection directories for inventory templates and data files
- Updated extension provisioning logic to use new data directory paths for
  Guacamole vars file
- Improved documentation in config methods to clarify new directory structure

**Removed:**

- Excluded `extensions` from `build_ignore` in `ansible/galaxy.yml` to align
  with new file organization and avoid ignoring essential extension files
…change, ws01

**Added:**

- Introduced VM definitions for elk, wazuh, guacamole, exchange, and ws01 roles
  across AWS, Azure, Proxmox, VirtualBox, VMware, and Ludus platforms
- Provided Terraform configurations for each role on relevant cloud providers,
  including platform-specific settings like AMIs, instance sizes, IPs, and
  authentication details
- Added Ludus YAML configs for each VM type to support Ludus-based deployment
- Included Vagrantfiles for VirtualBox and VMware for local VM creation,
  specifying resource allocations and networking for each VM
- Added extended Proxmox configuration example for ws01, demonstrating variable
  definitions and merging for advanced scenarios

**Changed:**

- No existing files were changed; all additions are new resources for VM
  provisioning across multiple platforms

**Removed:**

- No files or configurations were removed in this change
**Changed:**

- Disabled the MD011 rule (no reversed links) in markdownlint configuration to
  allow more flexibility in markdown formatting - .hooks/linters/markdownlint.json
@l50 l50 merged commit aa39ce0 into main Apr 2, 2026
6 checks passed
@l50 l50 deleted the refactor/idiomatic-ansible-extensions branch April 2, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ad-labs Changes made to AD lab definitions area/docs Changes made to documentation area/extensions Changes made to extensions (ELK, Exchange, Wazuh, etc.) area/github Changes made to github actions area/playbooks Changes made to playbooks directory area/pre-commit Changes made to pre-commit hooks area/python Changes made to Python application code area/roles Changes made to Ansible roles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant