# Running Playbooks

## Usage

```bash
auberge ansible run                           # Interactive
auberge ansible run --host H --playbook P    # Explicit
auberge ansible run --tags TAG               # Auto-resolves playbook dependencies
auberge ansible run --playbook P --tags TAG  # Explicit playbook, no auto-resolve
```

## Examples

```bash
# Full stack: deploy all apps
auberge deploy --all

# Specific layer (power-user)
auberge ansible run --playbook playbooks/apps.yml

# Specific apps
auberge ansible run --tags baikal,freshrss

# Single component
auberge ansible run --tags caddy
```

## Common Scenarios

**First deployment:**

```bash
auberge ansible bootstrap auberge --ip IP
auberge deploy --all
```

**Update single app (auto-resolves infrastructure first):**

```bash
auberge ansible run --tags baikal
```

**Update infrastructure:**

```bash
auberge ansible run --tags infrastructure
```

## Options

- `-v, -vv, -vvv` - Verbose output (debugging)
- `--force` - Skip confirmation (CI/CD)
- `--check` - Preview without applying

## Error Handling

Ansible stops on first failure. Fix issue and re-run (idempotent - safe to retry).

**Connection issues:** See [SSH Problems](troubleshooting/ssh-problems.md)

## Best Practices

- Backup before updates: `auberge backup create`
- Use check mode for unfamiliar changes
- Verify services after: `ssh ansible@host "systemctl status app"`
