inventory fix

This commit is contained in:
2026-01-30 15:03:59 -05:00
parent 3b4f887e2a
commit 520d5e3535
2 changed files with 8 additions and 8 deletions

8
Jenkinsfile vendored
View File

@@ -52,9 +52,9 @@ pipeline {
// Build the limit flag // Build the limit flag
def limitValue = '' def limitValue = ''
if (isDockerPlaybook) { if (isDockerPlaybook) {
// Docker playbooks always target 'docker' tagged hosts // Docker playbooks always target 'docker_hosts' group
// If user provides a limit, use intersection (docker AND limit) // If user provides a limit, use intersection (docker_hosts AND limit)
limitValue = params.LIMIT ? "docker:&${params.LIMIT}" : 'docker' limitValue = params.LIMIT ? "docker_hosts:&${params.LIMIT}" : 'docker_hosts'
} else { } else {
limitValue = params.LIMIT ?: '' limitValue = params.LIMIT ?: ''
} }
@@ -67,7 +67,7 @@ pipeline {
echo "Check flag: '${checkFlag}'" echo "Check flag: '${checkFlag}'"
echo "Limit: '${limitValue}'" echo "Limit: '${limitValue}'"
if (isDockerPlaybook) { if (isDockerPlaybook) {
echo "Docker playbook detected - targeting hosts with 'docker' tag" echo "Docker playbook detected - targeting 'docker_hosts' group"
} }
sh """ sh """

View File

@@ -35,19 +35,19 @@ The Jenkins pipeline provides a parameterized build with:
| `LIMIT` | Optionally limit to specific hosts (e.g., `plex`, `media-app`) | | `LIMIT` | Optionally limit to specific hosts (e.g., `plex`, `media-app`) |
| `DRY_RUN` | Run in check mode without making changes | | `DRY_RUN` | Run in check mode without making changes |
The pipeline automatically targets hosts with the `docker` tag. When a limit is provided, it uses an intersection pattern (`docker:&<limit>`) to ensure only docker-tagged hosts matching the limit are affected. The pipeline automatically targets hosts in the `docker_hosts` group. When a limit is provided, it uses an intersection pattern (`docker_hosts:&<limit>`) to ensure only docker hosts matching the limit are affected.
### Via Command Line ### Via Command Line
```bash ```bash
# Update all docker hosts # Update all docker hosts
ansible-playbook -i inventories/inventory.proxmox.yml playbooks/dockerUpdate.yml --limit docker ansible-playbook -i inventories/inventory.proxmox.yml playbooks/dockerUpdate.yml --limit docker_hosts
# Update a specific host # Update a specific host
ansible-playbook -i inventories/inventory.proxmox.yml playbooks/dockerUpdate.yml --limit docker:&plex ansible-playbook -i inventories/inventory.proxmox.yml playbooks/dockerUpdate.yml --limit 'docker_hosts:&plex'
# Prune all docker hosts (dry run) # Prune all docker hosts (dry run)
ansible-playbook -i inventories/inventory.proxmox.yml playbooks/dockerPrune.yaml --limit docker --check --diff ansible-playbook -i inventories/inventory.proxmox.yml playbooks/dockerPrune.yaml --limit docker_hosts --check --diff
``` ```
## Inventory ## Inventory