Ansible Provisioning of Containers

jontyh

New Member
Aug 15, 2016
4
0
1
47
Hi,

Trying to use Ansible to provision LXC containers on a single Proxmox HV.
ansible-playbook 2.1.0.0
pve-manager/4.2-17/e1400248 (running kernel: 4.4.15-1-pve)


This is using the Ansible module from the core extras module (http://docs.ansible.com/ansible/proxmox_module.html)

Ansible snippet (passwords obscured):

proxmox: vmid=101 node='hv1' api_user='root@pam' state=present onboot=true api_password='xxxxx' api_host='hv1' password='xxxx' hostname='lxc-001' ostemplate='local:vztmpl/centos-7-default_20160205_amd64.tar.xz'

Error on running:
AILED! => {"changed": false, "failed": true, "msg": "creation of lxc VM 101 failed with exception: 400 Bad Request"}

And now I'm not sure where to look as to what is generating the '400 Bad request' or even if this version of Ansible and Proxmox are compatible.

Any help gratefully received!

JOnty
 
Just a little bit more information, if I manually create a CT using the GUI, I can then successfully use Ansible to start/stop the container, which suggests the API is working etc - I'm assuming there is a required parameter for creation that perhaps I'm missing.... ?
 
I have error like.
creation of lxc VM 164 failed with exception: 400 Bad Request: {"data":null,"errors":{"[287].size":"property is missing and it is not optional"}}"
Version:
ansible 2.8.2
pveversion -v
proxmox-ve: 5.4-2 (running kernel: 4.15.18-18-pve
proxmoxer==1.0.3

Maybe someone came across this.