add proxmox_delegate_host variable and update check-exists documentation
- Document proxmox_delegate_host for delegating pct commands to inventory host - Update check-exists.yml description to reflect vmid or hostname checking - Document lxc_exists fact set by idempotency check
This commit is contained in:
@@ -13,7 +13,7 @@ It also includes tasks which may be used individually:
|
||||
- `stop.yml`: Stops an LXC container
|
||||
- `update.yml`: Updates an existing LXC container
|
||||
- `wait.yml`: Waits for SSH to be available on the container
|
||||
- `check-exists.yml`: Checks the existence of the LXC with the given hostname
|
||||
- `check-exists.yml`: Checks if an LXC exists by `lxc_vmid` or `lxc_hostname`
|
||||
|
||||
## Requirements
|
||||
|
||||
@@ -41,6 +41,7 @@ It also includes tasks which may be used individually:
|
||||
|----------|-------------|---------|
|
||||
| `proxmox_api_port` | The port on which the Proxmox API is listening | `8006` |
|
||||
| `proxmox_api_validate_certs` | Whether to validate SSL certificates | `false` |
|
||||
| `proxmox_delegate_host` | Inventory hostname for delegated tasks (pct commands). Use this to inherit `ansible_become_password` from inventory. | `{{ proxmox_api_host }}` |
|
||||
|
||||
### Required Container Variables
|
||||
|
||||
@@ -88,6 +89,7 @@ proxmox_api_token_id: "mytoken"
|
||||
proxmox_api_token_secret: "{{ vault_proxmox_token }}"
|
||||
proxmox_api_validate_certs: false
|
||||
proxmox_node: "pve01"
|
||||
proxmox_delegate_host: "proxmox_server" # inventory hostname for become_password
|
||||
```
|
||||
|
||||
### Creating a new LXC from template
|
||||
@@ -122,7 +124,7 @@ proxmox_node: "pve01"
|
||||
|
||||
### Idempotent Behavior
|
||||
|
||||
The role includes idempotency checking. If a container with the specified `lxc_vmid` already exists, the role will skip provisioning and exit gracefully.
|
||||
The role includes idempotency checking. If a container with the specified `lxc_vmid` or `lxc_hostname` already exists, the role will skip provisioning and exit gracefully. Sets `lxc_exists` fact for use in subsequent tasks.
|
||||
|
||||
### Using Standalone Tasks
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
# Proxmox API connection defaults (optional)
|
||||
proxmox_api_port: 8006
|
||||
proxmox_api_validate_certs: false
|
||||
# Host to delegate pct commands to (use inventory hostname for become_password to work)
|
||||
proxmox_delegate_host: "{{ proxmox_api_host }}"
|
||||
|
||||
# LXC defaults
|
||||
lxc_template: "local:vztmpl/debian-12-standard_12.12-1_amd64.tar.zst"
|
||||
|
||||
Reference in New Issue
Block a user