Skip to content

Commit 84ef061

Browse files
working on adding vmid to netbox conditionally, that is if it has been generated automatically 3
1 parent 5fb4e88 commit 84ef061

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

awx-proxmox-clone-lxc-and-set-resources.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
custom_fields:
9999
proxmox_vmid: "{{ new_proxmox_lxc.proxmox_vms[0].vmid }}"
100100
state: present
101-
when: new_proxmox_lxc is defined and new_proxmox_lxc.proxmox_vms is defined and new_proxmox_lxc.proxmox_vms | length > 0 and vm_config['vmid'] is defined and vm_config['vmid'] == None
101+
when: new_proxmox_lxc is defined and new_proxmox_lxc.proxmox_vms is defined and new_proxmox_lxc.proxmox_vms | length > 0 and vm_config['vmid'] is defined and vm_config['vmid'] == "None"
102102

103103
- name: "Update Proxmox storage for LXC in NetBox"
104104
netbox.netbox.netbox_virtual_disk:

awx-proxmox-clone-vm-and-set-resources.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
custom_fields:
109109
proxmox_vmid: "{{ new_proxmox_vm.proxmox_vms[0].vmid }}"
110110
state: present
111-
when: new_proxmox_vm is defined and new_proxmox_vm.proxmox_vms is defined and new_proxmox_vm.proxmox_vms | length > 0 and vm_config['vmid'] is defined and vm_config['vmid'] == None
111+
when: new_proxmox_vm is defined and new_proxmox_vm.proxmox_vms is defined and new_proxmox_vm.proxmox_vms | length > 0 and vm_config['vmid'] is defined and vm_config['vmid'] == "None"
112112

113113
# ok: [localhost] => {
114114
# "msg": "New VM info: {'changed': False, 'proxmox_vms': [{'maxcpu': 1, 'status': 'stopped', 'netout': 0, 'vmid': 104, 'diskwrite': 0, 'id': 'qemu/104', 'uptime': 0, 'node': 'proxmox-ve', 'disk': 0, 'maxdisk': 2361393152, 'type': 'qemu', 'maxmem': 268435456, 'template': False, 'mem': 0, 'diskread': 0, 'netin': 0, 'cpu': 0, 'name': 'test2', 'cpus': 1, 'serial': 1}], 'failed': False}"

0 commit comments

Comments
 (0)