I am provisioning VMs through opennebula, but the provisioned VM hostname is always localhost.localdomain. I need to set hostname of newly provisioned VM automatically.
I tried to do with ansible or puppet, since both are new for me… I am not able to do it.
Although, from ansible command “ansible -m shell -a ‘hostname test1’ 192.168.1.228” it can be done, but that is manual task… I need to automate either during provisioning of VM through webUI of opennebula by additing script or after that using ansible/puppet.
I had tried below link also, but this will do everything as expected ( update /etc/hosts file, puppet client and master config, cert auto register), but hostname is not getting change in this method also.
Can you please help it