title: Is it possible to have conditionals in hiera yaml?
body: <p>I am trying to achieve following. - I have certain variables defined in hiera yaml for a.yaml - Some of the variables I want to read from the external facts. - However whenever an external fact is not defined I want to use some default.</p>
  
  <p>So for example</p>
  
  <pre><code>---
  key1: value1
  key2: %{value2_from_facts} | value2
  </code></pre>
  
  <p>In this case if custom fact 'value2fromfacts' is not defined, I want key2 to have value2. Is this possible?</p>
  
  <p>Is there any better alternative to having defaults assigned to hiera variable if the facts used are not resolved?</p>