From c846a3ae37578cea6b7d1efe9e30c3398b43bff4 Mon Sep 17 00:00:00 2001 From: "Z. Cliffe Schreuders" Date: Fri, 17 Jan 2025 10:00:43 +0000 Subject: [PATCH] Enhance Vagrantfile for Proxmox support by adding hostname provisioning for non-Windows systems --- lib/templates/Vagrantfile.erb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/templates/Vagrantfile.erb b/lib/templates/Vagrantfile.erb index 525099d05..7965b995d 100644 --- a/lib/templates/Vagrantfile.erb +++ b/lib/templates/Vagrantfile.erb @@ -221,10 +221,15 @@ end <%= system.name %>.vm.box = 'ovirt4' <%= system.name %>.vm.box_url = 'https://github.com/myoung34/vagrant-ovirt4/blob/master/example_box/dummy.box?raw=true' <% -when "proxmox" # nothing + when "proxmox" %> <%= system.name %>.vm.box = 'dummy' <%= system.name %>.vm.box_url = 'https://github.com/myoung34/vagrant-ovirt4/blob/master/example_box/dummy.box?raw=true' + + <% if selected_module.attributes['platform'].first.downcase != 'windows' %> + # Set hostname for Linux systems (as an extra step on Proxmox) + <%= system.name %>.vm.provision 'shell', inline: "hostname <%= system.get_hostname %> && echo <%= system.get_hostname %> > /etc/hostname && sed -i \"s/127.0.1.1.*/127.0.1.1\t<%= system.get_hostname %>/g\" /etc/hosts" + <% end %> <% when "esxi" %>