title: Suppress Ansible Ad Hoc Warning
body: <p>I have a python script that takes advantage of an Ansible ad hoc command to get host information quickly. I'd like to suppress the warning when I'm attempting to gather information about a host that is in a different VPC, but shows in the following command used to find all instances:</p>
  
  <pre><code>aws ec2 describe-instances
  </code></pre>
  
  <p>Below is the python snippet I'm using to make and generate the ansible ad hoc command:</p>
  
  <pre><code>command_string = "ansible -i /repo/ansible/inventory/"+env+"/hosts " + name + " -m shell -a 'df -h'"
  result = subprocess.Popen(command_string, shell=True, stdout=subprocess.PIPE).stdout.read()
  </code></pre>
  
  <p>I understand that in a playbook setting for the shell module:</p>
  
  <pre><code>warn=no
  </code></pre>
  
  <p>will disable warnings, but I can't seem to figure out how to do so via adhoc, see below test:</p>
  
  <pre><code>[root@box-1b 10.0.5.xxx:~] ansible -i /repo/ansible/inventory/nqa/hosts 10.19.1.17 -m shell -a 'warn=no'
  [WARNING]: No hosts matched, nothing to do
  
  [root@box-1b 10.0.5.xxx:~] ansible -i /repo/ansible/inventory/nqa/hosts 10.19.1.17 -m shell -a 'warn=false'
  [WARNING]: No hosts matched, nothing to do
  </code></pre>
  
  <p>The output of my full script looks similar to the following:</p>
  
  <pre><code>i-xxxxxx
      my-super-cool-box
      t2.small    True
      10.0.0.10
      vol-xxxxxxx
      100
      i-xxxxxxx
      /dev/xvdf
  
  
   [WARNING]: No hosts matched, nothing to do
   [WARNING]: No hosts matched, nothing to do
   [WARNING]: No hosts matched, nothing to do
  </code></pre>
  
  <p>The information printed about the specific instance is correct, and all I'm looking for is a way to suppress that warning without changing the global ansible configurations.</p>