title: Multiple control conditions validation in puppet
body: <p>I need to validate agent like memory, processor, and port connectivity  before running my other manifest files. So I've created a manifest like following by keeping global facts with and statement and exec resource.</p>
  
  <pre><code>class vc {
  #Validateing Infra Before applying chnages
  if $::facts['memorysize'] &gt;= '4.00 GiB'and $::facts['processorcount'] &gt;= 2 and Exec['port_connectivity'] {
    notify { "Infra validated" : }
    include vc::configs 
  }
  else {
    notify { "Infra not meeting requirements" : }
  } 
  # Checking port connecitivity to puppet master  
  exec { 'port_connectivity':
    command   =&gt; 'New-Item c:\debug.txt -type file -Force',
    unless    =&gt; 'if((New-Object System.Net.Sockets.TcpClient ("linux-NAS-storage.com",6163)).connected -eq $true) { exit 1 }',
    provider  =&gt; powershell,
    }  
  }
  </code></pre>
  
  <p>my theme is puppet should only execute if this <code>if $::facts['memorysize'] &gt;= '4.00 GiB'and $::facts['processorcount'] &gt;= 2 and Exec['port_connectivity']</code> condition was successful. If exec command was successful and facter returns true then only it should execute, but following manifest executing individually without checking whether that exec statement true or not. My main purpose I need to validate ports before running puppet manifest. Can any please help</p>