Skip to content

Lxc inv schema

Title: LXC Inventory

Type object
Required No
Additional properties Not allowed

Description: Inventory for creating lxcs on PVE.

Property Pattern Type Deprecated Definition Title/Description
+ target_pve No string No - Proxmox cluster name + . + pve cloud domain. This determines the cloud and the proxmox cluster the vms/lxc/k8s luster will be created in.
+ stack_name No string No - Your stack name, needs to be unique within the cloud domain.
- static_includes No object No - This property contains specific hosts / stacks that need to be included for a schema extension. This way playbooks can statically
reference a host group and assume it to be a certain stack (e.g. postgres/haproxy/dhcp).
- include_stacks No array of object No - Include other stacks into the ansible inventory, from any pve cloud you are connected to. From here you can freely extend and write your own playbooks.
+ root_ssh_pub_key No string No - trusted root key for the cloud init image.
- pve_ha_group No string No - PVE HA group this vm should be assigned to (optional).
- target_pve_hosts No array of string No - Array of proxmox hosts in the target pve that are eligible for scheduling. If not specified all online hosts are considered.
+ lxcs No array of object No - List of lxcs that will be created for the stack.
- lxc_global_vars No object No - Variables that will be applied to all lxc hosts and are available in playbooks.
- lxc_base_parameters No object No - PVE pct cli parameters that will be used for all lxcs.
- lxc_os_template No string No - `pveam available --section system` / run `pveam update` for newest, PVE available LXC template (will be downloaded).
- plugin No enum (of string) No - Id of ansible inventory plugin.

56. Property LXC Inventory > target_pve

Type string
Required Yes

Description: Proxmox cluster name + . + pve cloud domain. This determines the cloud and the proxmox cluster the vms/lxc/k8s luster will be created in.

Example:

"proxmox-cluster-a.your-cloud.domain"

57. Property LXC Inventory > stack_name

Type string
Required Yes

Description: Your stack name, needs to be unique within the cloud domain.

58. Property LXC Inventory > static_includes

Type object
Required No
Additional properties Any type allowed

Description: This property contains specific hosts / stacks that need to be included for a schema extension. This way playbooks can statically reference a host group and assume it to be a certain stack (e.g. postgres/haproxy/dhcp).

59. Property LXC Inventory > include_stacks

Type array of object
Required No

Description: Include other stacks into the ansible inventory, from any pve cloud you are connected to. From here you can freely extend and write your own playbooks.

Array restrictions
Min items N/A
Max items N/A
Items unicity False
Additional items False
Tuple validation See below
Each item of this array must be Description
include_stacks items -

59.1. LXC Inventory > include_stacks > include_stacks items

Type object
Required No
Additional properties Not allowed
Property Pattern Type Deprecated Definition Title/Description
+ stack_fqdn No string No - Target stack fqdn to include (stack name + pve_cloud_domain). Will automatically include it from the right pve cluster.
+ host_group No string No - This is the name of the hosts group of our ansible inventory the included vms/lxcs will be available under.
- qemu_ansible_user No string No - User ansible will use to connect, defaults to admin. If you dont want to use debian cinit images you might need to set something else than admin.
Ubuntu for example wont work if you set the cloud init user to admin.

59.1.1. Property LXC Inventory > include_stacks > include_stacks items > stack_fqdn

Type string
Required Yes

Description: Target stack fqdn to include (stack name + pve_cloud_domain). Will automatically include it from the right pve cluster.

Examples:

"bind.your-other-cloud.domain"
"other-k8s.your-other-cloud.domain"

59.1.2. Property LXC Inventory > include_stacks > include_stacks items > host_group

Type string
Required Yes

Description: This is the name of the hosts group of our ansible inventory the included vms/lxcs will be available under.

59.1.3. Property LXC Inventory > include_stacks > include_stacks items > qemu_ansible_user

Type string
Required No

Description: User ansible will use to connect, defaults to admin. If you dont want to use debian cinit images you might need to set something else than admin. Ubuntu for example wont work if you set the cloud init user to admin.

60. Property LXC Inventory > root_ssh_pub_key

Type string
Required Yes

Description: trusted root key for the cloud init image.

61. Property LXC Inventory > pve_ha_group

Type string
Required No

Description: PVE HA group this vm should be assigned to (optional).

62. Property LXC Inventory > target_pve_hosts

Type array of string
Required No

Description: Array of proxmox hosts in the target pve that are eligible for scheduling. If not specified all online hosts are considered.

Array restrictions
Min items N/A
Max items N/A
Items unicity False
Additional items False
Tuple validation See below
Each item of this array must be Description
target_pve_hosts items The hostname of the proxmox host. Just the hostname, no cluster name or cloud domain should be specified, as they are implicit.

62.1. LXC Inventory > target_pve_hosts > target_pve_hosts items

Type string
Required No

Description: The hostname of the proxmox host. Just the hostname, no cluster name or cloud domain should be specified, as they are implicit.

Example:

"proxmox-host-a"

63. Property LXC Inventory > lxcs

Type array of object
Required Yes

Description: List of lxcs that will be created for the stack.

Array restrictions
Min items N/A
Max items N/A
Items unicity False
Additional items False
Tuple validation See below
Each item of this array must be Description
lxcs items -

63.1. LXC Inventory > lxcs > lxcs items

Type object
Required No
Additional properties Any type allowed
Property Pattern Type Deprecated Definition Title/Description
- hostname No string No - Optional unique hostname for this lxc, otherwise pet name random name will be generated.
- target_host No string No - Pve host to tie this vm to. This is useful to always deploy specifically on a proxmox host.
- vars No object No - Custom variables for this lxc specifically. Will be usable in playbooks.
+ parameters No object No - Parameters that will be passed to pve pct cli tool for lxc creation.

63.1.1. Property LXC Inventory > lxcs > lxcs items > hostname

Type string
Required No

Description: Optional unique hostname for this lxc, otherwise pet name random name will be generated.

63.1.2. Property LXC Inventory > lxcs > lxcs items > target_host

Type string
Required No

Description: Pve host to tie this vm to. This is useful to always deploy specifically on a proxmox host.

63.1.3. Property LXC Inventory > lxcs > lxcs items > vars

Type object
Required No
Additional properties Any type allowed

Description: Custom variables for this lxc specifically. Will be usable in playbooks.

63.1.4. Property LXC Inventory > lxcs > lxcs items > parameters

Type object
Required Yes
Additional properties Any type allowed

Description: Parameters that will be passed to pve pct cli tool for lxc creation.

Property Pattern Type Deprecated Definition Title/Description
+ rootfs No string No - PVE storage for the container disk.
+ cores No integer No - Number of virtual CPU cores.
+ memory No integer No - Memory in bytes, use POW 2.
+ net0 No string No - Configuration for primary network interface.
63.1.4.1. Property LXC Inventory > lxcs > lxcs items > parameters > rootfs
Type string
Required Yes

Description: PVE storage for the container disk.

63.1.4.2. Property LXC Inventory > lxcs > lxcs items > parameters > cores
Type integer
Required Yes

Description: Number of virtual CPU cores.

63.1.4.3. Property LXC Inventory > lxcs > lxcs items > parameters > memory
Type integer
Required Yes

Description: Memory in bytes, use POW 2.

63.1.4.4. Property LXC Inventory > lxcs > lxcs items > parameters > net0
Type string
Required Yes

Description: Configuration for primary network interface.

Example:

"name=eth0,bridge=vmbr0,tag=120,firewall=1,ip=dhcp"

64. Property LXC Inventory > lxc_global_vars

Type object
Required No
Additional properties Any type allowed

Description: Variables that will be applied to all lxc hosts and are available in playbooks.

Property Pattern Type Deprecated Definition Title/Description
- use_alternate_ssh_port No boolean No - Will use 2222 instead of 22 for ssh.
- install_prom_systemd_exporter No boolean No - Will install prometheus metrics exporter for systemd. This implements with pve cloud terraform monitoring modules.
Will also make the lxc visible for discovery by monitoring.
- No object No - -

64.1. Property LXC Inventory > lxc_global_vars > use_alternate_ssh_port

Type boolean
Required No

Description: Will use 2222 instead of 22 for ssh.

64.2. Property LXC Inventory > lxc_global_vars > install_prom_systemd_exporter

Type boolean
Required No

Description: Will install prometheus metrics exporter for systemd. This implements with pve cloud terraform monitoring modules. Will also make the lxc visible for discovery by monitoring.

65. Property LXC Inventory > lxc_base_parameters

Type object
Required No
Additional properties Any type allowed

Description: PVE pct cli parameters that will be used for all lxcs.

66. Property LXC Inventory > lxc_os_template

Type string
Required No

Description: pveam available --section system / run pveam update for newest, PVE available LXC template (will be downloaded).

67. Property LXC Inventory > plugin

Type enum (of string)
Required No

Description: Id of ansible inventory plugin.

Must be one of:

  • "pxc.cloud.lxc_inv"