Hi, I encounter some issue when I tried to find a way, to pass cloud-init to machine with ansible and connect to API.
Actually I using this ansible module:
https://docs.ansible.com/ansible/2.3/proxmox_kvm_module.html
There are my tasks:
I looking how I can execute it from localhost and add cloud-init related stuff, like cloud-init file etc.
My main goal due to automatical dhcp and dns settings are to change template 'hostname' and 'ssh key' as desired by ansible variable before this machine starts.
Any tips how to obtain it guys?
Actually I using this ansible module:
https://docs.ansible.com/ansible/2.3/proxmox_kvm_module.html
There are my tasks:
Code:
---
- name: "Clone CentOS"
proxmox_kvm:
api_user : "{{ api_user }}"
api_password: "{{ api_password }}"
api_host : "{{ api_host }}"
node : "{{ proxmox_node }}"
storage : "{{ proxmox_storage }}"
clone : "{{ VM_source_name }}" # Have to be shutted down
name : "{{ VM_output_name }}" # Have to be unique, different then others
format : "{{ VM_data_format }}"
timeout : "{{ timeout_for_clonning_after }}"
vcpus : "{{ VM_Vcpu }}"
cores : "{{ VM_cores }}"
memory : "{{ VM_RAM_memory }}"
register: Clone_output
failed_when: >
(Clone_output.msg == "VM with name <{{ VM_output_name }}> already exists")
- name: "Start Clone"
proxmox_kvm:
api_user : "{{ api_user }}"
api_password: "{{ api_password }}"
api_host : "{{ api_host }}"
name : "{{ VM_output_name }}"
node : "{{ proxmox_node }}"
state : started
register: Start_output
until: "not Start_output.failed"
retries: 3
delay: 5
I looking how I can execute it from localhost and add cloud-init related stuff, like cloud-init file etc.
My main goal due to automatical dhcp and dns settings are to change template 'hostname' and 'ssh key' as desired by ansible variable before this machine starts.
Any tips how to obtain it guys?