title: Hash element reference inside puppet manifest
body: <p>I'm trying to complete one of the first exercises, which is including the <code>hostname</code> and <code>osname</code> facts in the <code>/etc/motd</code>. I simply cannot get this to work properly. I cannot get an element out of a hash.</p>
  
  <p>I'm using the VM at puppet, and the copy and paste isn't working for me so I'll use screenshots.</p>
  
  <p><a href="https://i.stack.imgur.com/IN7Ku.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IN7Ku.png" alt="enter image description here"></a></p>
  
  <p>So I create my <code>motd.pp</code>:</p>
  
  <p><a href="https://i.stack.imgur.com/HMsAu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HMsAu.png" alt="enter image description here"></a></p>
  
  <p>But after running <code>puppet apply motd.pp</code>, I see this:</p>
  
  <p><a href="https://i.stack.imgur.com/6p8pu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6p8pu.png" alt="enter image description here"></a></p>
  
  <p>I've tried:</p>
  
  <pre><code>$os[name]
  $os['name']
  ${os}[name]
  ${os}['name']
  $facts['os']['name']
  $::os['name']
  $::os[name]
  </code></pre>
  
  <p>Pretty much every permutation I could think of and it always ignores the <code>[name]</code> or <code>[os][name]</code> part of the variable.</p>