title: Vagrantfile and external config - what am I doing wrong?
body: <p>Never used Ruby but this seems straight forward enough having looked at a few examples - not working - what am I missing?</p>
  
  <p><strong>vmconfig.yml:</strong></p>
  
  <pre><code>server:   
      hostname: mydomain.com
  </code></pre>
  
  <p><strong>Vagrantfile</strong>:</p>
  
  <pre><code>require 'yaml'
  vmconfig = YAML.load_file('vmconfig.yml')
  
  Vagrant.configure(2) do |config|
    config.vm.box = "debian/contrib-jessie64"
  
    config.vm.provision "shell", inline: &lt;&lt;-SHELL
      apt-get update
  
      hostname vmconfig["server"]["hostname"]
      config.vm.synced_folder ".", "/vagrant", type: "virtualbox"
  end
  </code></pre>
  
  <p>hostname is not set (to what config file should) when VM is finished building??? If I hardcode the value it works fine???</p>