Skip to content

Conversation

@0xinterface
Copy link
Contributor

This pull request introduces two new Ansible roles for managing Consul and Consul-Template, including their installation, configuration, and testing. It also adds supporting files for CI and integration testing, and enhances the Nomad job specification for improved update handling. The most important changes are grouped as follows:

Ansible Role: Consul

  • Added a new consul role with tasks for installing Consul, configuring with templates (consul.hcl.j2, server.hcl.j2, tls.hcl.j2), handling TLS, managing dev/production modes, and setting up a shell environment script (consul.sh). [1] [2] [3] [4] [5]
  • Included role metadata (meta/main.yml), default variables, and Molecule scenarios for testing the role. [1] [2] [3] [4]

Ansible Role: Consul-Template

  • Added a new consul-template role to install and configure Consul-Template, including repository setup, service management, configuration templating, and integration with systemd. [1] [2] [3]
  • Provided role metadata, default variables, and Molecule scenarios for testing. [1] [2] [3] [4] [5]
  • Added handlers for systemd reload and service restart.

Continuous Integration

  • Introduced a GitHub Actions workflow (.github/workflows/roles.yml) to automatically lint and test all Ansible roles using Molecule on code changes.

Nomad Job Specification

  • Refactored the matchbox.nomad.hcl job file to move the update stanza from the group level to the job level for improved update behavior. [1] [2]

@0xinterface 0xinterface force-pushed the feature/ansible-roles branch from fb571d4 to 66cdc87 Compare October 21, 2025 06:42
0xinterface and others added 16 commits November 3, 2025 22:46
- Docker role: Added service management, user group handling, Docker Compose installation, daemon configuration, and systemd overrides
- Incus role: Added service management, user group handling, auto-initialization, storage pool and network configuration
- Tailscale role: Added authentication setup, service management, hostname configuration, exit node and subnet route advertising
- Truststore role: Added meta/main.yml, handlers, molecule test structure, support for multiple certificates and removal

All roles now include:
- Proper service enablement and startup
- Handler definitions for service restarts
- Complete variable definitions with defaults
- Documentation and usage examples
- Molecule test configurations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
…ness

Major improvements to all Ansible roles for better testing and reliability:

Consul Role:
- Fixed filename issue (removed leading space from tasks/main.yml)
- Added missing variables: consul_retry_join, consul_gossip_key
- Created consul.sh environment script for profile.d
- Fixed molecule configuration with proper ANSIBLE_ROLES_PATH
- Enhanced prepare playbook with python3-debian for deb822_repository module

Nomad Role:
- Created missing nomad.sh.j2 template for environment configuration
- Added missing variables: nomad_gossip_key, nomad_host_volumes
- Fixed plugins.hcl to use template instead of static file
- Corrected meta description from "Tailscale" to "Nomad"
- Updated molecule configuration for proper role discovery

Consul-Template Role:
- Added complete service configuration with systemd service file
- Created consul-template.hcl.j2 configuration template
- Added handlers for service restart
- Enhanced with vault and consul connection configurations
- Fixed molecule testing setup

Docker Role:
- Enhanced from previous work with service management
- Added Docker Compose installation support
- User group management for docker access
- Daemon configuration via templates

Incus Role:
- Enhanced from previous work with service management
- Added incus-admin group configuration
- Auto-initialization support for Incus setup

Tailscale Role:
- Enhanced from previous work with authentication setup
- Added service management and configuration options
- Fixed molecule converge.yml role reference

Truststore Role:
- Created missing meta/main.yml for Galaxy compatibility
- Added complete molecule test structure
- Support for multiple CA certificates
- Proper handlers for CA trust updates

Testing Infrastructure:
- All prepare.yml files now install required packages:
  * python3-debian (for deb822_repository module)
  * gnupg (for GPG key handling)
  * systemd (for service management)
- Fixed molecule.yml provisioner configuration in all roles
- Standardized converge.yml with consistent include_role syntax
- Set ANSIBLE_ROLES_PATH correctly for role discovery

All roles are now production-ready with:
- Proper service lifecycle management
- Configuration templating
- Handler definitions for restarts
- Complete variable defaults
- Molecule test structures
- Ansible 2.15+ compatibility

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@0xinterface 0xinterface force-pushed the feature/ansible-roles branch from 66cdc87 to d23bb67 Compare November 3, 2025 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant