title: Use facter facts in puppet
body: <p>I am new to puppet and planning to implement it in our environment.</p>
  
  <p>I have puppet agents that are running on different versions of Redhat.</p>
  
  <p>Now, I am planing to push repo files from the puppet master, and I need your guidance to implement the same. </p>
  
  <p>I have the below manifests.</p>
  
  <pre><code>file { 'local_repo':
    ensure =&gt; file,
    path   =&gt; '/etc/yum.repos.d/local.repo',
    mode   =&gt; "600",
    source =&gt; 'puppet:///modules/repo/rhel7.1',
  }
  
  file { 'local_repo':
    ensure =&gt; file,
    path   =&gt; '/etc/yum.repos.d/local.repo',
    mode   =&gt; "600",
    source =&gt; 'puppet:///modules/repo/rhel6.7',
  }
  </code></pre>
  
  <p>When I execute the Facter CLI I get the below output.</p>
  
  <pre><code>[root@dheera ~]# facter os
  {
    architecture =&gt; "x86_64",
    family =&gt; "RedHat",
    hardware =&gt; "x86_64",
    name =&gt; "RedHat",
    release =&gt; {
      full =&gt; "7.2",
      major =&gt; "7",
      minor =&gt; "2"
    }
  }
  </code></pre>
  
  <p>I want to make use of the above output and execute my manifests accordingly. That is, if the puppet agent is executing on Redhat 7.1, then the Puppet master uses the corresponding file.</p>