title: Override Ansible facts similar to Puppet and Facter override
body: <p>NOTE: Part of Puppet to Ansible migration evaluation. Ansible noob.</p>
  
  <p>CentOS 7 returns <code>operatingsystemrelease</code> (puppet) or <code>ansible_distribution_version</code> (ansible) as 7.2.1511 instead of just 7.2. So in puppet we use the following hack. </p>
  
  <pre><code># Hack for CentOS 7. operatingsystemrelease includes third part of release version eg 7.2.1511
  if [[ "$(facter operatingsystem)" == "CentOS" &amp;&amp; "$(facter operatingsystemmajrelease)" == "7" ]]
  then
      export FACTER_operatingsystemrelease=$(facter operatingsystemmajrelease).$(facter --json os | grep minor | awk '{ print $2 }' | tr '",' ' ' | sed -e 's/ //g')
  fi
  </code></pre>
  
  <p>Setting environment variable <code>FACTER_operatingsystemrelease</code> overrides the <code>operatingsystemrelease</code> value. This needs to happen only for CentOS 7. CentOS 6 works fine.</p>
  
  <p>What would be the equivalent way to make this work in Ansible?</p>