Hi Community,
I am currently working on an automated rollout for UCS systems using Proxmox. To achieve this, Univention requires an existing network interface so that my Ansible playbooks can execute the profile setup and join setup to create a Primary Node (or at least test if the playbooks are executed at all).
According to the Ansible documentation, the only way to add an IP configuration is through
However, the image needs to be a cloud-init image to use the Ansible
Another potential solution is to have a VM with the QEMU guest agent installed and try to configure the network interface.( which i tried but it didnt execute)
The VM loaded with the qcow2 image does not have the QEMU guest agent installed, and I am unsure how to add it since the image was provided to me
(There is a way to add it, but it defeats the purpose of the automatisation process, because you need to ssh into the VM and install from there)
Has anyone dealt with similar issues? What tips or solutions can you suggest to make this work?
Every bit of help is appreciated!
I am currently working on an automated rollout for UCS systems using Proxmox. To achieve this, Univention requires an existing network interface so that my Ansible playbooks can execute the profile setup and join setup to create a Primary Node (or at least test if the playbooks are executed at all).
According to the Ansible documentation, the only way to add an IP configuration is through
ipconfig: ipconfig0: 'ip=<enter-ip-here/prefix>,gw=<gateway>
However, the image needs to be a cloud-init image to use the Ansible
ipconfig
attribute.Another potential solution is to have a VM with the QEMU guest agent installed and try to configure the network interface.( which i tried but it didnt execute)
The VM loaded with the qcow2 image does not have the QEMU guest agent installed, and I am unsure how to add it since the image was provided to me
(There is a way to add it, but it defeats the purpose of the automatisation process, because you need to ssh into the VM and install from there)
Has anyone dealt with similar issues? What tips or solutions can you suggest to make this work?
Every bit of help is appreciated!
YAML:
---
- name: Creating Proxmox VM
gather_facts: false
hosts: [proxmox_host]
serial: 1
tasks:
- name: Create a Virtual Machine with Template
community.general.proxmox_kvm:
api_user: 'api_user'
api_host: host_ip
api_token_id: 'token_id'
api_token_secret: 'secret_token'
node: 'node name'
clone: 'VM-Template2'
vmid: 104
newid: 105
full: yes
name: UCS-Master
timeout: 600
- name: Add IP-adress to VM #Does not work
community.general.proxmox_kvm:
api_user: 'api_user'
api_host: host_ip
api_token_id: 'token_id'
api_token_secret: 'secret_token'
node: 'node name'
vmid: 105
ipconfig:
ipconfig0: 'ipv4/24, gw=gateway'
nameservers:
- 'gatewayip'
- '8.8.4.4'
- name: Update IP-Address of VM #Also does not work because a cloud-init image is needed
ansible.builtin.shell:
cmd: qm set 105 --ipconfig0 ip=ipv4/24,gw=gatewayip