title: Ansible - host_list declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
body: <p>My local <code>/etc/ansible/hosts</code> file just has</p>
  
  <pre><code>[example]
  172.31.nn.nnn
  </code></pre>
  
  <p>Why do I get that</p>
  
  <pre><code>host_list declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
  </code></pre>
  
  <p>message ?</p>
  
  <p>If I change it to</p>
  
  <pre><code>[local]
  localhost ansible_connection=local
  </code></pre>
  
  <p>it seems to work ok.
  But that is limited to local. I want to ping my aws instance from my local machine.</p>
  
  <p>Full message:</p>
  
  <pre><code>ansible 2.8.0
    config file = /etc/ansible/ansible.cfg
    configured module search path = [u'/home/michael/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
    ansible python module location = /home/michael/.local/lib/python2.7/site-packages/ansible
    executable location = /usr/bin/ansible
    python version = 2.7.15rc1 (default, Nov 12 2018, 14:31:15) [GCC 7.3.0]
  Using /etc/ansible/ansible.cfg as config file
  setting up inventory plugins
  host_list declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
  script declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
  auto declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
  Parsed /etc/ansible/hosts inventory source with ini plugin
  Loading callback plugin minimal of type stdout, v2.0 from /home/michael/.local/lib/python2.7/site-packages/ansible/plugins/callb
  ack/minimal.pyc
  META: ran handlers
  &lt;172.31.40.133&gt; ESTABLISH SSH CONNECTION FOR USER: ubuntu
  &lt;172.31.40.133&gt; SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/home/michael/Dropbox/90_201
  9/work/aws/rubymd2.pem"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,p
  ublickey -o PasswordAuthentication=no -o 'User="ubuntu"' -o ConnectTimeout=10 -o ControlPath=/home/michael/.ansible/cp/7e7a30892
  f 172.31.40.133 '/bin/sh -c '"'"'echo ~ubuntu &amp;&amp; sleep 0'"'"''
  &lt;172.31.40.133&gt; (255, '', 'OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017\r\ndebug1: Reading configuration data /et
  c/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\nd
  ebug1: Control socket "/home/michael/.ansible/cp/7e7a30892f" does not exist\r\ndebug2: resolving "172.31.40.133" port 22\r\ndebu
  g2: ssh_connect_direct: needpriv 0\r\ndebug1: Connecting to 172.31.40.133 [172.31.40.133] port 22.\r\ndebug2: fd 3 setting O_NON
  BLOCK\r\ndebug1: connect to address 172.31.40.133 port 22: Connection timed out\r\nssh: connect to host 172.31.40.133 port 22: C
  onnection timed out\r\n')
  172.31.40.133 | UNREACHABLE! =&gt; {
      "changed": false, 
      "msg": "Failed to connect to the host via ssh: OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017\r\ndebug1: Readin
  g configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Try
  ing existing master\r\ndebug1: Control socket \"/home/michael/.ansible/cp/7e7a30892f\" does not exist\r\ndebug2: resolving \"172
  .31.40.133\" port 22\r\ndebug2: ssh_connect_direct: needpriv 0\r\ndebug1: Connecting to 172.31.40.133 [172.31.40.133] port 22.\r
  \ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: connect to address 172.31.40.133 port 22: Connection timed out\r\nssh: connect to h
  ost 172.31.40.133 port 22: Connection timed out", 
      "unreachable": true
  }
  </code></pre>
  
  <p>I tried ading [inventory] at the top and also enable_plugins = ini.  The first didn't help and the second gave a parse message.</p>
  
  <p>fyi security group info:</p>
  
  <p><a href="https://i.stack.imgur.com/xQqPO.png" rel="noreferrer"><img src="https://i.stack.imgur.com/xQqPO.png" alt="enter image description here"></a></p>