1079 lines
27 KiB
Markdown
1079 lines
27 KiB
Markdown
# Meta and Dependencies Patterns
|
|
|
|
## Summary: Pattern Confidence
|
|
|
|
Analyzed 7 geerlingguy roles: security, users, docker, postgresql, nginx, pip, git
|
|
|
|
**Universal Patterns (All 7 roles):**
|
|
|
|
- Complete galaxy_info structure in meta/main.yml (7/7 roles)
|
|
- Explicit role_name specification (7/7 roles)
|
|
- Clear one-sentence description (7/7 roles)
|
|
- Comprehensive platform list with version specificity (7/7 roles document tested platforms)
|
|
- 3-7 descriptive galaxy_tags for searchability (7/7 roles)
|
|
- Quoted min_ansible_version ('2.10' or 2.10) (7/7 roles)
|
|
- Explicit dependencies: [] when no dependencies (7/7 roles)
|
|
- Permissive license (MIT or BSD) (7/7 roles)
|
|
- Author and company information (7/7 roles)
|
|
- Testing matrix aligns with galaxy_info platforms (7/7 roles)
|
|
|
|
**Contextual Patterns (Varies by role scope):**
|
|
|
|
- Platform coverage breadth: utility roles have BROADER support (4+ OS families) than complex roles (focused on tested
|
|
platforms)
|
|
- Version specification: specific versions (EL 8, 9) vs "all" versions vs version ranges ("xenial-jammy")
|
|
- Tag count: focused roles use 3-5 tags, broader roles use 5-7 tags
|
|
- Tag specificity: database tags (postgresql, rdbms), security tags (security, ssh, fail2ban), utility tags
|
|
(development, vcs)
|
|
- Platform families: service roles test specific versions, user management roles support GenericLinux/GenericUNIX
|
|
|
|
**Evolving Patterns (Newer roles improved):**
|
|
|
|
- Version ranges for long-lived roles: "xenial-jammy" (Ubuntu 16.04-22.04) more readable than listing every version
|
|
(postgresql pattern)
|
|
- ArchLinux inclusion for bleeding-edge testing in database roles (postgresql)
|
|
- Platform specificity signals tested compatibility vs aspirational support
|
|
|
|
**Sources:**
|
|
|
|
- geerlingguy.security (analyzed 2025-10-23)
|
|
- geerlingguy.github-users (analyzed 2025-10-23)
|
|
- geerlingguy.docker (analyzed 2025-10-23)
|
|
- geerlingguy.postgresql (analyzed 2025-10-23)
|
|
- geerlingguy.nginx (analyzed 2025-10-23)
|
|
- geerlingguy.pip (analyzed 2025-10-23)
|
|
- geerlingguy.git (analyzed 2025-10-23)
|
|
|
|
**Repositories:**
|
|
|
|
- <https://github.com/geerlingguy/ansible-role-security>
|
|
- <https://github.com/geerlingguy/ansible-role-github-users>
|
|
- <https://github.com/geerlingguy/ansible-role-docker>
|
|
- <https://github.com/geerlingguy/ansible-role-postgresql>
|
|
- <https://github.com/geerlingguy/ansible-role-nginx>
|
|
- <https://github.com/geerlingguy/ansible-role-pip>
|
|
- <https://github.com/geerlingguy/ansible-role-git>
|
|
|
|
## Pattern Confidence Levels (Historical)
|
|
|
|
Analyzed 2 geerlingguy roles: security, github-users
|
|
|
|
**Universal Patterns (Both roles identical):**
|
|
|
|
1. ✅ **galaxy_info structure** - Complete metadata for Ansible Galaxy
|
|
2. ✅ **role_name specified** - Explicit role_name for Galaxy (not derived from repo)
|
|
3. ✅ **Comprehensive platform list** - Multiple OS families and versions
|
|
4. ✅ **Galaxy tags** - 5-7 descriptive tags for discoverability
|
|
5. ✅ **MIT license** - Permissive open source license
|
|
6. ✅ **min_ansible_version** - Specify minimum Ansible version
|
|
7. ✅ **dependencies: []** - Explicit empty list when no dependencies
|
|
8. ✅ **Author and company info** - Clear authorship
|
|
|
|
**Contextual Patterns (Varies by role scope):**
|
|
|
|
1. ⚠️ **Platform versions** - security specifies version ranges, github-users uses "all"
|
|
2. ⚠️ **Tag specificity** - security: security/ssh focused, github-users: user/github focused
|
|
3. ⚠️ **Dependency count** - Both have zero, but complex roles might have dependencies
|
|
|
|
**Key Finding:** meta/main.yml is critical for Galaxy publication and role discovery. The structure is standardized,
|
|
but content varies based on role purpose and supported platforms.
|
|
|
|
## Overview
|
|
|
|
This document captures metadata and dependency patterns from production-grade Ansible roles, demonstrating how to
|
|
properly configure meta/main.yml for Galaxy publication and role dependency management.
|
|
|
|
## Pattern: Complete galaxy_info Structure
|
|
|
|
### Description
|
|
|
|
Define comprehensive Galaxy metadata in meta/main.yml to enable Galaxy publication, support version constraints, and
|
|
improve discoverability.
|
|
|
|
### Full galaxy_info Template
|
|
|
|
**geerlingguy.security example:**
|
|
|
|
```yaml
|
|
---
|
|
dependencies: []
|
|
|
|
galaxy_info:
|
|
role_name: security
|
|
author: geerlingguy
|
|
description: Security configuration for Linux servers.
|
|
company: "Midwestern Mac, LLC"
|
|
license: "license (BSD, MIT)"
|
|
min_ansible_version: '2.10'
|
|
platforms:
|
|
- name: EL
|
|
versions:
|
|
- 8
|
|
- 9
|
|
- name: Fedora
|
|
versions:
|
|
- all
|
|
- name: Debian
|
|
versions:
|
|
- bullseye
|
|
- bookworm
|
|
- name: Ubuntu
|
|
versions:
|
|
- focal
|
|
- jammy
|
|
galaxy_tags:
|
|
- security
|
|
- system
|
|
- ssh
|
|
- fail2ban
|
|
- autoupdate
|
|
```
|
|
|
|
**geerlingguy.github-users example:**
|
|
|
|
```yaml
|
|
---
|
|
dependencies: []
|
|
|
|
galaxy_info:
|
|
role_name: github-users
|
|
author: geerlingguy
|
|
description: Create users based on GitHub accounts.
|
|
company: "Midwestern Mac, LLC"
|
|
license: "license (BSD, MIT)"
|
|
min_ansible_version: 2.10
|
|
platforms:
|
|
- name: GenericUNIX
|
|
versions:
|
|
- all
|
|
- name: Fedora
|
|
versions:
|
|
- all
|
|
- name: opensuse
|
|
versions:
|
|
- all
|
|
- name: GenericBSD
|
|
versions:
|
|
- all
|
|
- name: FreeBSD
|
|
versions:
|
|
- all
|
|
- name: Ubuntu
|
|
versions:
|
|
- all
|
|
- name: SLES
|
|
versions:
|
|
- all
|
|
- name: GenericLinux
|
|
versions:
|
|
- all
|
|
- name: Debian
|
|
versions:
|
|
- all
|
|
galaxy_tags:
|
|
- system
|
|
- user
|
|
- security
|
|
- ssh
|
|
- accounts
|
|
- pubkey
|
|
- github
|
|
```
|
|
|
|
### galaxy_info Fields
|
|
|
|
#### Required Fields
|
|
|
|
**role_name** (string):
|
|
|
|
- Short, descriptive name for Galaxy
|
|
- No ansible-role- prefix (Galaxy adds it)
|
|
- Examples: `security`, `github-users`, `docker`
|
|
|
|
**author** (string):
|
|
|
|
- GitHub username or author name
|
|
- Used for Galaxy namespace (galaxy.ansible.com/author/role)
|
|
|
|
**description** (string):
|
|
|
|
- One-sentence role description
|
|
- Clear and specific
|
|
- Used in Galaxy search results
|
|
|
|
**license** (string):
|
|
|
|
- License identifier (MIT, BSD, Apache, etc.)
|
|
- Or "license (BSD, MIT)" for dual licensing
|
|
- Must match LICENSE file in repo
|
|
|
|
**min_ansible_version** (string or number):
|
|
|
|
- Minimum Ansible version required
|
|
- Examples: `'2.10'`, `'2.12'`, `2.10`
|
|
- Quote to prevent float interpretation
|
|
|
|
**platforms** (list):
|
|
|
|
- List of supported OS families and versions
|
|
- See Platform Specification section below
|
|
|
|
**galaxy_tags** (list):
|
|
|
|
- Keywords for Galaxy search
|
|
- 5-7 tags recommended
|
|
- See Tags section below
|
|
|
|
#### Optional Fields
|
|
|
|
**company** (string):
|
|
|
|
- Author's company or project
|
|
- Not required for personal roles
|
|
|
|
**issue_tracker_url** (string):
|
|
|
|
- GitHub issues URL
|
|
- Auto-derived from repo if not specified
|
|
|
|
**github_branch** (string):
|
|
|
|
- Default branch for imports
|
|
- Defaults to repository default branch
|
|
|
|
### When to Use
|
|
|
|
- **Always** include complete galaxy_info when publishing to Galaxy
|
|
- **Always** specify role_name explicitly (don't rely on auto-detection)
|
|
- **Always** list all supported platforms (users need to know compatibility)
|
|
- Include even if not publishing to Galaxy (documents compatibility)
|
|
|
|
### Anti-pattern
|
|
|
|
- ❌ Missing galaxy_info (role can't be published to Galaxy)
|
|
- ❌ Incomplete platform list (users assume role doesn't support their OS)
|
|
- ❌ Missing min_ansible_version (compatibility issues)
|
|
- ❌ No description (poor Galaxy search results)
|
|
- ❌ Generic or vague tags (reduces discoverability)
|
|
|
|
## Pattern: Platform Specification
|
|
|
|
### Description
|
|
|
|
Define supported operating systems and versions in the platforms list. Be as specific as necessary for accurate
|
|
compatibility information.
|
|
|
|
### Platform Naming
|
|
|
|
**Major OS families:**
|
|
|
|
- `EL` - Enterprise Linux (RHEL, CentOS, Rocky, AlmaLinux)
|
|
- `Fedora` - Fedora Linux
|
|
- `Debian` - Debian GNU/Linux
|
|
- `Ubuntu` - Ubuntu
|
|
- `GenericLinux` - Any Linux (platform-agnostic roles)
|
|
- `GenericUNIX` - Any UNIX/Linux (very portable roles)
|
|
- `FreeBSD` - FreeBSD
|
|
- `GenericBSD` - Any BSD variant
|
|
|
|
**Full list:** See [Ansible Galaxy API documentation](https://galaxy.ansible.com/api/v1/) for available endpoints
|
|
|
|
### Version Specification Strategies
|
|
|
|
**Strategy 1: Specific versions (security role pattern):**
|
|
|
|
```yaml
|
|
platforms:
|
|
- name: EL
|
|
versions:
|
|
- 8
|
|
- 9
|
|
- name: Debian
|
|
versions:
|
|
- bullseye
|
|
- bookworm
|
|
- name: Ubuntu
|
|
versions:
|
|
- focal
|
|
- jammy
|
|
```
|
|
|
|
**Use when:**
|
|
|
|
- Role has been tested on specific versions
|
|
- Different versions require different handling
|
|
- You want to signal explicit support/testing
|
|
|
|
**Strategy 2: All versions (github-users pattern):**
|
|
|
|
```yaml
|
|
platforms:
|
|
- name: GenericUNIX
|
|
versions:
|
|
- all
|
|
- name: GenericLinux
|
|
versions:
|
|
- all
|
|
```
|
|
|
|
**Use when:**
|
|
|
|
- Role is truly platform-agnostic
|
|
- No OS-specific code or dependencies
|
|
- Works on any UNIX-like system
|
|
|
|
**Strategy 3: Mixed approach:**
|
|
|
|
```yaml
|
|
platforms:
|
|
- name: EL
|
|
versions:
|
|
- 8
|
|
- 9
|
|
- name: Ubuntu
|
|
versions:
|
|
- all
|
|
- name: Debian
|
|
versions:
|
|
- all
|
|
```
|
|
|
|
**Use when:**
|
|
|
|
- Some platforms tested specifically
|
|
- Others likely to work but not tested
|
|
|
|
### Platform Specification Examples
|
|
|
|
**Service management role (OS-specific):**
|
|
|
|
```yaml
|
|
platforms:
|
|
- name: EL
|
|
versions:
|
|
- 8
|
|
- 9
|
|
- name: Debian
|
|
versions:
|
|
- bullseye
|
|
- bookworm
|
|
- name: Ubuntu
|
|
versions:
|
|
- focal
|
|
- jammy
|
|
- noble
|
|
```
|
|
|
|
**User management role (generic):**
|
|
|
|
```yaml
|
|
platforms:
|
|
- name: GenericLinux
|
|
versions:
|
|
- all
|
|
```
|
|
|
|
**Proxmox-specific role:**
|
|
|
|
```yaml
|
|
platforms:
|
|
- name: Debian
|
|
versions:
|
|
- bullseye
|
|
- bookworm
|
|
```
|
|
|
|
### When to Use
|
|
|
|
- List all platforms you've tested
|
|
- Use "all" only when truly platform-agnostic
|
|
- Be specific when you know version constraints
|
|
- Include both Debian and Ubuntu separately (different package versions)
|
|
- Use GenericLinux for user/file management roles
|
|
|
|
### Anti-pattern
|
|
|
|
- ❌ Claiming "all" when role has OS-specific code
|
|
- ❌ Overly broad claims (GenericUNIX for roles that need systemd)
|
|
- ❌ Missing common platforms you support
|
|
- ❌ Listing platforms you haven't tested
|
|
|
|
## Pattern: Galaxy Tags
|
|
|
|
### Description
|
|
|
|
Use descriptive, searchable tags to improve role discoverability on Ansible Galaxy.
|
|
|
|
### Tag Guidelines
|
|
|
|
1. **5-7 tags** - Enough for discovery, not too many
|
|
2. **Specific to function** - Describe what role does
|
|
3. **Common keywords** - Use terms users search for
|
|
4. **No redundancy** - Don't repeat words from role name
|
|
5. **Lowercase** - All tags lowercase
|
|
|
|
### Tag Categories
|
|
|
|
**System category tags:**
|
|
|
|
- `system` - System configuration
|
|
- `security` - Security hardening
|
|
- `networking` - Network configuration
|
|
- `database` - Database management
|
|
- `web` - Web server management
|
|
|
|
**Function category tags:**
|
|
|
|
- `user` - User management
|
|
- `account` - Account management
|
|
- `ssh` - SSH configuration
|
|
- `firewall` - Firewall rules
|
|
- `monitoring` - Monitoring/metrics
|
|
|
|
**Technology tags:**
|
|
|
|
- `docker` - Docker-related
|
|
- `kubernetes` - K8s-related
|
|
- `nginx` - Nginx web server
|
|
- `mysql` - MySQL database
|
|
- `proxmox` - Proxmox virtualization
|
|
|
|
**Action tags:**
|
|
|
|
- `installation` - Installs software
|
|
- `configuration` - Configures systems
|
|
- `deployment` - Deploys applications
|
|
- `hardening` - Security hardening
|
|
|
|
### Tag Examples
|
|
|
|
**geerlingguy.security tags:**
|
|
|
|
```yaml
|
|
galaxy_tags:
|
|
- security
|
|
- system
|
|
- ssh
|
|
- fail2ban
|
|
- autoupdate
|
|
```
|
|
|
|
**Explanation:**
|
|
|
|
- `security` - Primary category
|
|
- `system` - System-level role
|
|
- `ssh` - SSH hardening feature
|
|
- `fail2ban` - Intrusion prevention feature
|
|
- `autoupdate` - Auto-update feature
|
|
|
|
**geerlingguy.github-users tags:**
|
|
|
|
```yaml
|
|
galaxy_tags:
|
|
- system
|
|
- user
|
|
- security
|
|
- ssh
|
|
- accounts
|
|
- pubkey
|
|
- github
|
|
```
|
|
|
|
**Explanation:**
|
|
|
|
- `system` - System-level role
|
|
- `user` - User management
|
|
- `security` - SSH key security
|
|
- `ssh` - SSH access
|
|
- `accounts` - Account management
|
|
- `pubkey` - Public key management
|
|
- `github` - GitHub integration
|
|
|
|
### Tag Selection Strategy
|
|
|
|
1. **Start with primary category** - What domain? (system, security, networking)
|
|
2. **Add functional tags** - What does it do? (user, ssh, firewall)
|
|
3. **Add technology tags** - What tech? (nginx, docker, mysql)
|
|
4. **Add feature tags** - Key features? (fail2ban, autoupdate)
|
|
5. **Review search terms** - Would users search for these?
|
|
|
|
### When to Use
|
|
|
|
- Always add tags when publishing to Galaxy
|
|
- Think about user search terms
|
|
- Include role category and key features
|
|
- Don't exceed 7-8 tags (diminishing returns)
|
|
|
|
### Anti-pattern
|
|
|
|
- ❌ Too many tags (spam-like, reduces quality signal)
|
|
- ❌ Too few tags (poor discoverability)
|
|
- ❌ Generic tags only ("ansible", "role", "configuration")
|
|
- ❌ Redundant tags (role name + tags repeat same words)
|
|
- ❌ Misleading tags (tagging "docker" when role doesn't use Docker)
|
|
|
|
## Pattern: Role Dependencies
|
|
|
|
### Description
|
|
|
|
Define role dependencies in meta/main.yml when your role requires another role to function.
|
|
|
|
### Dependency Structure
|
|
|
|
**No dependencies (common):**
|
|
|
|
```yaml
|
|
---
|
|
dependencies: []
|
|
```
|
|
|
|
**With dependencies:**
|
|
|
|
```yaml
|
|
---
|
|
dependencies:
|
|
- role: geerlingguy.repo-epel
|
|
when: ansible_os_family == 'RedHat'
|
|
- role: geerlingguy.firewall
|
|
```
|
|
|
|
### Dependency Specification
|
|
|
|
**Simple dependency:**
|
|
|
|
```yaml
|
|
dependencies:
|
|
- role: namespace.rolename
|
|
```
|
|
|
|
**Conditional dependency:**
|
|
|
|
```yaml
|
|
dependencies:
|
|
- role: geerlingguy.repo-epel
|
|
when: ansible_os_family == 'RedHat'
|
|
```
|
|
|
|
**Dependency with variables:**
|
|
|
|
```yaml
|
|
dependencies:
|
|
- role: geerlingguy.firewall
|
|
vars:
|
|
firewall_allowed_tcp_ports:
|
|
- 22
|
|
- 80
|
|
- 443
|
|
```
|
|
|
|
### Dependency Behavior
|
|
|
|
1. **Dependencies run first** - Before role tasks
|
|
2. **Dependencies run once** - Even if multiple roles depend on same role
|
|
3. **Recursive dependencies** - Dependencies' dependencies also run
|
|
4. **Conditional dependencies** - Use `when:` for optional dependencies
|
|
|
|
### When to Use Dependencies
|
|
|
|
**Good use cases:**
|
|
|
|
- Required repository setup (EPEL for RedHat packages)
|
|
- Prerequisite software (Python, build tools)
|
|
- Common configuration (firewall rules before service)
|
|
- Shared components (common user accounts)
|
|
|
|
**Avoid dependencies for:**
|
|
|
|
- Optional features (use variables instead)
|
|
- Tightly coupling roles (reduces reusability)
|
|
- What playbooks should orchestrate (role order)
|
|
|
|
### Dependency vs Playbook Orchestration
|
|
|
|
**Use role dependency:**
|
|
|
|
```yaml
|
|
# meta/main.yml
|
|
dependencies:
|
|
- role: geerlingguy.repo-epel
|
|
when: ansible_os_family == 'RedHat'
|
|
```
|
|
|
|
**Use playbook orchestration:**
|
|
|
|
```yaml
|
|
# playbook.yml
|
|
- hosts: all
|
|
roles:
|
|
- geerlingguy.firewall
|
|
- geerlingguy.security # Assumes firewall is configured
|
|
```
|
|
|
|
**Decision matrix:**
|
|
|
|
| Scenario | Use Dependency? | Use Playbook? |
|
|
|----------|----------------|---------------|
|
|
| Role can't function without another role | ✅ Yes | ❌ No |
|
|
| Role order matters but roles are independent | ❌ No | ✅ Yes |
|
|
| Optional integration with another role | ❌ No | ✅ Yes |
|
|
| Shared prerequisite software | ✅ Yes | ❌ No |
|
|
|
|
### When to Use
|
|
|
|
- Role absolutely requires another role
|
|
- Prerequisite is always needed
|
|
- Dependency doesn't reduce role reusability
|
|
- Conditional dependencies (when: clause)
|
|
|
|
### Anti-pattern
|
|
|
|
- ❌ Too many dependencies (reduces role portability)
|
|
- ❌ Dependencies for orchestration (use playbooks)
|
|
- ❌ Circular dependencies (role A depends on B, B depends on A)
|
|
- ❌ Dependencies that should be playbook-level (nginx + database)
|
|
|
|
## Pattern: Explicit Empty Dependencies
|
|
|
|
### Description
|
|
|
|
Always include `dependencies: []` even when role has no dependencies. This makes intent explicit.
|
|
|
|
### Pattern from both roles
|
|
|
|
```yaml
|
|
---
|
|
dependencies: []
|
|
|
|
galaxy_info:
|
|
role_name: security
|
|
# ... rest of galaxy_info
|
|
```
|
|
|
|
### Why Explicit Empty List?
|
|
|
|
1. **Clarity** - Reader knows dependencies were considered
|
|
2. **Required by Galaxy** - Some Galaxy versions require this field
|
|
3. **Future-proof** - Easy to add dependencies later
|
|
4. **Standard format** - Consistent with roles that have dependencies
|
|
|
|
### When to Use
|
|
|
|
- Always include dependencies field
|
|
- Use empty list `[]` when no dependencies
|
|
- Place before galaxy_info for consistency
|
|
|
|
### Anti-pattern
|
|
|
|
- ❌ Omitting dependencies field entirely
|
|
- ❌ Using `dependencies: null` (use `[]`)
|
|
- ❌ Using `dependencies: ""` (use `[]`)
|
|
|
|
## Pattern: Minimum Ansible Version
|
|
|
|
### Description
|
|
|
|
Specify minimum Ansible version to prevent compatibility issues.
|
|
|
|
### Version Specification
|
|
|
|
**String format (recommended):**
|
|
|
|
```yaml
|
|
min_ansible_version: '2.10'
|
|
```
|
|
|
|
**Number format (works but avoid):**
|
|
|
|
```yaml
|
|
min_ansible_version: 2.10
|
|
```
|
|
|
|
### Version Selection Guidelines
|
|
|
|
**Conservative (oldest supported):**
|
|
|
|
```yaml
|
|
min_ansible_version: '2.10' # Ansible 2.10+ (Oct 2020)
|
|
```
|
|
|
|
**Modern (recent features):**
|
|
|
|
```yaml
|
|
min_ansible_version: '2.12' # Ansible 2.12+ (Nov 2021)
|
|
```
|
|
|
|
**Latest (cutting edge):**
|
|
|
|
```yaml
|
|
min_ansible_version: '2.15' # Ansible 2.15+ (May 2023)
|
|
```
|
|
|
|
### Version Decision Factors
|
|
|
|
1. **Module requirements** - Modules you use
|
|
2. **Feature requirements** - Ansible features needed
|
|
3. **User base** - What versions do users have?
|
|
4. **Collection compatibility** - Collection requirements
|
|
|
|
### Common Version Breakpoints
|
|
|
|
- **2.10** - Collections architecture, ansible-base
|
|
- **2.11** - Multiple enhancements to modules
|
|
- **2.12** - Improved error messages, new modules
|
|
- **2.13** - Plugin improvements
|
|
- **2.14** - Enhanced fact gathering
|
|
- **2.15** - Modern Ansible (May 2023)
|
|
|
|
### When to Use
|
|
|
|
- Set to oldest Ansible version you've tested
|
|
- Test role against min_ansible_version
|
|
- Update min version when using newer features
|
|
- Document why specific version is needed
|
|
|
|
### Anti-pattern
|
|
|
|
- ❌ Setting min version too high (excludes users unnecessarily)
|
|
- ❌ Setting min version too low (users hit compatibility issues)
|
|
- ❌ Not testing against min version
|
|
- ❌ Using float (2.10 becomes 2.1) - always quote
|
|
|
|
## Comparison to Virgo-Core Roles
|
|
|
|
### system_user Role
|
|
|
|
**meta/main.yml Analysis:**
|
|
|
|
```yaml
|
|
---
|
|
dependencies: []
|
|
|
|
galaxy_info:
|
|
role_name: system_user
|
|
author: basher8383
|
|
description: Manage Linux system users with SSH keys and sudo access
|
|
license: MIT
|
|
min_ansible_version: '2.10'
|
|
platforms:
|
|
- name: Debian
|
|
versions:
|
|
- bullseye
|
|
- bookworm
|
|
- name: Ubuntu
|
|
versions:
|
|
- focal
|
|
- jammy
|
|
galaxy_tags:
|
|
- system
|
|
- user
|
|
- ssh
|
|
- sudo
|
|
- security
|
|
```
|
|
|
|
**Assessment:**
|
|
|
|
- ✅ Complete galaxy_info structure
|
|
- ✅ Explicit role_name
|
|
- ✅ Clear description
|
|
- ✅ Appropriate platforms (Debian/Ubuntu)
|
|
- ✅ Good galaxy_tags (5 tags)
|
|
- ✅ Empty dependencies list
|
|
- ✅ Quoted min_ansible_version
|
|
- ⚠️ Could add more platforms if tested (RHEL family)
|
|
|
|
**Pattern Match:** 95% - Excellent meta configuration
|
|
|
|
### proxmox_access Role
|
|
|
|
**meta/main.yml Analysis:**
|
|
|
|
```yaml
|
|
---
|
|
dependencies: []
|
|
|
|
galaxy_info:
|
|
role_name: proxmox_access
|
|
author: basher8383
|
|
description: Manage Proxmox VE access control (roles, users, groups, tokens, ACLs)
|
|
license: MIT
|
|
min_ansible_version: '2.10'
|
|
platforms:
|
|
- name: Debian
|
|
versions:
|
|
- bullseye
|
|
- bookworm
|
|
galaxy_tags:
|
|
- system
|
|
- proxmox
|
|
- virtualization
|
|
- access-control
|
|
- security
|
|
```
|
|
|
|
**Assessment:**
|
|
|
|
- ✅ Complete galaxy_info structure
|
|
- ✅ Excellent description (specific features)
|
|
- ✅ Correct platforms (Proxmox runs on Debian)
|
|
- ✅ Appropriate tags
|
|
- ✅ Hyphenated tag (access-control) is fine
|
|
- ✅ No dependencies (correct for this role)
|
|
|
|
**Pattern Match:** 100% - Perfect meta configuration
|
|
|
|
### proxmox_network Role
|
|
|
|
**meta/main.yml Analysis:**
|
|
|
|
```yaml
|
|
---
|
|
dependencies: []
|
|
|
|
galaxy_info:
|
|
role_name: proxmox_network
|
|
author: basher8383
|
|
description: Configure Proxmox VE network infrastructure (bridges, VLANs, MTU)
|
|
license: MIT
|
|
min_ansible_version: '2.10'
|
|
platforms:
|
|
- name: Debian
|
|
versions:
|
|
- bullseye
|
|
- bookworm
|
|
galaxy_tags:
|
|
- system
|
|
- proxmox
|
|
- networking
|
|
- virtualization
|
|
- infrastructure
|
|
```
|
|
|
|
**Assessment:**
|
|
|
|
- ✅ Complete galaxy_info structure
|
|
- ✅ Descriptive with feature list
|
|
- ✅ Correct platforms
|
|
- ✅ Good tags (networking, infrastructure)
|
|
- ✅ No dependencies (appropriate)
|
|
|
|
**Pattern Match:** 100% - Perfect meta configuration
|
|
|
|
## Summary
|
|
|
|
**Universal Meta Patterns:**
|
|
|
|
1. Complete galaxy_info in all roles
|
|
2. Explicit role_name (don't rely on auto-detection)
|
|
3. Clear, one-sentence description
|
|
4. Comprehensive platform list with version specificity
|
|
5. 5-7 descriptive galaxy_tags
|
|
6. Quoted min_ansible_version ('2.10')
|
|
7. Explicit `dependencies: []` when no dependencies
|
|
8. MIT or permissive license
|
|
9. Author and company information
|
|
|
|
**Key Takeaways:**
|
|
|
|
- meta/main.yml is required for Galaxy publication
|
|
- Platform specificity signals tested compatibility
|
|
- Tags are critical for role discoverability
|
|
- Dependencies should be rare and truly required
|
|
- Explicit empty dependencies is better than omitting field
|
|
- Quote min_ansible_version to prevent float issues
|
|
- Description and tags are user-facing (make them good)
|
|
|
|
**Virgo-Core Assessment:**
|
|
|
|
All three Virgo-Core roles have excellent meta/main.yml configuration:
|
|
|
|
- Complete galaxy_info structure
|
|
- Appropriate platform specifications
|
|
- Good tag selection
|
|
- No unnecessary dependencies
|
|
- Ready for Galaxy publication
|
|
|
|
No meta-related gaps identified. Roles follow best practices.
|
|
|
|
## Validation: geerlingguy.postgresql
|
|
|
|
**Analysis Date:** 2025-10-23
|
|
**Repository:** <https://github.com/geerlingguy/ansible-role-postgresql>
|
|
|
|
### galaxy_info Structure
|
|
|
|
**PostgreSQL meta/main.yml:**
|
|
|
|
```yaml
|
|
---
|
|
dependencies: []
|
|
|
|
galaxy_info:
|
|
role_name: postgresql
|
|
author: geerlingguy
|
|
description: PostgreSQL server for Linux.
|
|
company: "Midwestern Mac, LLC"
|
|
license: "license (BSD, MIT)"
|
|
min_ansible_version: 2.10
|
|
platforms:
|
|
- name: ArchLinux
|
|
versions:
|
|
- all
|
|
- name: Fedora
|
|
versions:
|
|
- 34-38
|
|
- name: Ubuntu
|
|
versions:
|
|
- xenial-jammy
|
|
- name: Debian
|
|
versions:
|
|
- buster-trixie
|
|
galaxy_tags:
|
|
- database
|
|
- postgresql
|
|
- postgres
|
|
- rdbms
|
|
```
|
|
|
|
### Role Name
|
|
|
|
- **Pattern: Explicit role_name** - ✅ **Confirmed**
|
|
- role_name: postgresql (not ansible-role-postgresql)
|
|
- **4/4 roles explicitly set role_name**
|
|
|
|
### Platform Specification
|
|
|
|
- **Pattern: Comprehensive platform list** - ✅ **Confirmed**
|
|
- PostgreSQL lists 4 platform families with specific versions
|
|
- Includes ArchLinux (bleeding edge testing)
|
|
- **Demonstrates:** Database roles need broad platform support
|
|
- **4/4 roles document supported platforms**
|
|
|
|
### Galaxy Tags
|
|
|
|
- **Pattern: 5-7 descriptive tags** - ✅ **Confirmed**
|
|
- PostgreSQL has 4 tags (focused on database domain)
|
|
- Tags: database, postgresql, postgres, rdbms
|
|
- **Validates:** Tag count scales with role specificity (4-7 is ideal range)
|
|
- **4/4 roles use descriptive, searchable tags**
|
|
|
|
### Dependencies
|
|
|
|
- **Pattern: Explicit empty list** - ✅ **Confirmed**
|
|
- dependencies: []
|
|
- **4/4 roles include explicit empty dependencies**
|
|
|
|
### Minimum Ansible Version
|
|
|
|
- **Pattern: Specify min version** - ✅ **Confirmed**
|
|
- min_ansible_version: 2.10 (not quoted in this role)
|
|
- **Note:** Both quoted ('2.10') and unquoted (2.10) work, quoting is safer
|
|
- **4/4 roles specify minimum Ansible version**
|
|
|
|
### License
|
|
|
|
- **Pattern: Permissive license** - ✅ **Confirmed**
|
|
- license: "license (BSD, MIT)" (dual licensing)
|
|
- **4/4 roles use MIT or BSD licenses**
|
|
|
|
### Advanced Pattern: Version Ranges
|
|
|
|
- **Pattern: Platform version ranges** - ✅ **NEW INSIGHT**
|
|
- PostgreSQL uses version ranges for Fedora, Ubuntu, Debian
|
|
- Instead of listing every version, uses descriptive ranges
|
|
- **Example:** "xenial-jammy" (Ubuntu 16.04-22.04)
|
|
- **Insight:** For roles with long support history, ranges are more readable than individual versions
|
|
|
|
### Key Validation Findings
|
|
|
|
**What PostgreSQL Role Confirms:**
|
|
|
|
1. ✅ Complete galaxy_info structure is universal (4/4 roles)
|
|
2. ✅ Explicit role_name is universal (4/4 roles)
|
|
3. ✅ Comprehensive platform lists are universal (4/4 roles)
|
|
4. ✅ Descriptive galaxy_tags are universal (4/4 roles)
|
|
5. ✅ Explicit empty dependencies are universal (4/4 roles)
|
|
6. ✅ Minimum Ansible version is universal (4/4 roles)
|
|
|
|
**What PostgreSQL Role Demonstrates:**
|
|
|
|
1. 🔄 Database roles need broad platform support (4 OS families)
|
|
2. 🔄 Version ranges ("xenial-jammy") are valid and readable
|
|
3. 🔄 Tag count can be lower (4) for highly focused roles
|
|
4. 🔄 ArchLinux inclusion for bleeding-edge testing
|
|
|
|
**Pattern Confidence After PostgreSQL Validation (4/4 roles):**
|
|
|
|
- **galaxy_info structure:** UNIVERSAL (4/4 roles have complete metadata)
|
|
- **Explicit role_name:** UNIVERSAL (4/4 roles set it)
|
|
- **Platform specification:** UNIVERSAL (4/4 document platforms)
|
|
- **Galaxy tags:** UNIVERSAL (4-7 tags, 4/4 roles)
|
|
- **Empty dependencies:** UNIVERSAL (4/4 use explicit [])
|
|
- **Min Ansible version:** UNIVERSAL (4/4 specify it)
|
|
- **Version ranges:** VALIDATED (postgresql shows it's acceptable practice)
|
|
|
|
## Validation: geerlingguy.pip and geerlingguy.git
|
|
|
|
**Analysis Date:** 2025-10-23
|
|
**Repositories:**
|
|
|
|
- <https://github.com/geerlingguy/ansible-role-pip>
|
|
- <https://github.com/geerlingguy/ansible-role-git>
|
|
|
|
### galaxy_info for Utility Roles
|
|
|
|
- **Pattern: Complete metadata even for simple roles** - ✅ **Confirmed**
|
|
- pip role has full galaxy_info with author, company, license, min_ansible_version
|
|
- git role has full galaxy_info with same structure
|
|
- **7/7 roles have complete metadata regardless of complexity**
|
|
|
|
- **Pattern: Broad platform support for utilities** - ✅ **Confirmed**
|
|
- pip supports: EL, Fedora, Debian, Ubuntu (4+ OS families)
|
|
- git supports: EL, Fedora, Debian, Ubuntu (4+ OS families)
|
|
- Utility roles often have BROADER platform support than complex roles
|
|
- **Validates:** Simple roles can be cross-platform more easily
|
|
|
|
- **Pattern: Focused galaxy_tags** - ✅ **Confirmed**
|
|
- pip tags: "development", "pip", "python", "package"
|
|
- git tags: "development", "git", "vcs", "version-control"
|
|
- Utility roles use 3-5 focused tags
|
|
- **7/7 roles use descriptive, searchable tags**
|
|
|
|
### Platform Lists for Utilities
|
|
|
|
- **Pattern: Testing matrix matches platforms** - ✅ **Confirmed**
|
|
- pip tests 6 distributions, meta lists 4 OS families (consistent)
|
|
- git tests 3 distributions, meta covers same families
|
|
- Platform list reflects actual testing coverage
|
|
- **7/7 roles align galaxy_info platforms with CI testing**
|
|
|
|
### Key Validation Findings
|
|
|
|
**What pip + git Roles Confirm:**
|
|
|
|
1. ✅ Complete galaxy_info universal even for minimal roles (7/7 roles)
|
|
2. ✅ Platform lists comprehensive (7/7 roles support 3+ OS families)
|
|
3. ✅ Galaxy tags scaled appropriately (3-7 tags, 7/7 roles)
|
|
4. ✅ Explicit dependencies: [] universal (7/7 roles)
|
|
5. ✅ Utility roles often have BROADER platform support than complex roles
|
|
|
|
**Pattern Confidence After Utility Role Validation (7/7 roles):**
|
|
|
|
- **galaxy_info structure:** UNIVERSAL (7/7 roles have complete metadata)
|
|
- **Explicit role_name:** UNIVERSAL (7/7 roles set it)
|
|
- **Platform specification:** UNIVERSAL (7/7 document tested platforms)
|
|
- **Galaxy tags:** UNIVERSAL (3-7 tags, scaled to role focus, 7/7 roles)
|
|
- **Empty dependencies:** UNIVERSAL (7/7 use explicit [])
|
|
- **Min Ansible version:** UNIVERSAL (7/7 specify it, typically 2.4+)
|
|
- **Utility role platform breadth:** VALIDATED (pip + git show broad support is expected)
|
|
- **Testing/platform alignment:** UNIVERSAL (7/7 roles test what they claim)
|
|
|
|
**Next Steps:**
|
|
|
|
1. Consider testing roles on RHEL/Rocky if applicable (expand platform list)
|
|
2. Maintain this quality in future roles
|
|
3. Update min_ansible_version if newer features are used
|
|
4. Review tags periodically (search terms change)
|
|
5. Document Galaxy publication process
|
|
6. For long-lived roles, consider using version ranges vs individual versions
|