- name: Create instances
proxmox:
node='simpsons'
api_user='{{ proxmox.api.username }}'
api_password='{{ proxmox.api.password }}'
api_host='localhost'
password='{{ item.hostname | b64encode | to_uuid }}'
hostname='{{ item.hostname }}'
onboot=yes
memory={{ item.memory }}
ostemplate='local:vztmpl/debian-8.0-standard_8.4-1_amd64.tar.gz'
netif='
{"net0":"name=eth0,gw=10.100.0.1,ip=10.100.0.{{
item.id }}/24,bridge=vmbr0"}
{% item.public_ip is defined %}
,
{"net1":"name=eth1,gw=100.100.100.1,ip={{ item.public_ip }}/24,bridge=vmbr0,mac={{ item.public_mac }}"}
{% endif %}'
with_items: "{{ containers }}"