|
|
|
@@ -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
|
|
|
|
|
|
|
|
|
|