From b4e43a035a08fe1c0dfa2283f9ef1973ab0d08ad Mon Sep 17 00:00:00 2001 From: Aneesh Agrawal Date: Sun, 13 Mar 2016 20:08:26 -0400 Subject: [PATCH] Use Vagrant to set the VM hostname This has the benefit that Salt will automatically pick up on the hostname and use it as the minion id, removing the need to manually pass the minion ID in the Vagrantfile and when debugging inside the VM. --- Vagrantfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 007f5e28..e4ce5de7 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -7,7 +7,7 @@ def extract_id(env) id[0] end -Vagrant.require_version '>= 1.8.0' +Vagrant.require_version '>= 1.8.5' Vagrant.configure(2) do |config| @@ -48,13 +48,12 @@ Vagrant.configure(2) do |config| end machine.vm.synced_folder dir, state_root machine.vm.synced_folder File.join(dir, '.travis', 'test_pillars'), pillar_root + machine.vm.hostname = node[:id] machine.vm.provision :salt do |salt| salt.bootstrap_script = File.join(dir, '.travis', 'install_salt.sh') salt.install_args = node[:os] # Pass OS type to bootstrap script salt.masterless = true salt.minion_config = minion_config_path - # hack to provide additional options to salt-call - salt.minion_id = node[:id] + ' --retcode-passthrough' salt.run_highstate = true salt.verbose = true salt.log_level = 'info'