inventory fix
This commit is contained in:
8
Jenkinsfile
vendored
8
Jenkinsfile
vendored
@@ -52,9 +52,9 @@ pipeline {
|
||||
// Build the limit flag
|
||||
def limitValue = ''
|
||||
if (isDockerPlaybook) {
|
||||
// Docker playbooks always target 'docker' tagged hosts
|
||||
// If user provides a limit, use intersection (docker AND limit)
|
||||
limitValue = params.LIMIT ? "docker:&${params.LIMIT}" : 'docker'
|
||||
// Docker playbooks always target 'docker_hosts' group
|
||||
// If user provides a limit, use intersection (docker_hosts AND limit)
|
||||
limitValue = params.LIMIT ? "docker_hosts:&${params.LIMIT}" : 'docker_hosts'
|
||||
} else {
|
||||
limitValue = params.LIMIT ?: ''
|
||||
}
|
||||
@@ -67,7 +67,7 @@ pipeline {
|
||||
echo "Check flag: '${checkFlag}'"
|
||||
echo "Limit: '${limitValue}'"
|
||||
if (isDockerPlaybook) {
|
||||
echo "Docker playbook detected - targeting hosts with 'docker' tag"
|
||||
echo "Docker playbook detected - targeting 'docker_hosts' group"
|
||||
}
|
||||
|
||||
sh """
|
||||
|
||||
@@ -35,19 +35,19 @@ The Jenkins pipeline provides a parameterized build with:
|
||||
| `LIMIT` | Optionally limit to specific hosts (e.g., `plex`, `media-app`) |
|
||||
| `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
|
||||
|
||||
```bash
|
||||
# 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
|
||||
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)
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user