title: Ansible setup module fails
body: <p>I have a lot of hosts managing by ansible
  and on the one hosts setup module fails:</p>
  
  <pre><code>user@Work:~  &gt;&gt; ansible -vvvv -i "10.10.10.2," all -m setup                                                                                  [20:00:24]
  Using /etc/ansible/ansible.cfg as config file
  Loaded callback minimal of type stdout, v2.0
  &lt;10.10.10.2&gt; ESTABLISH SSH CONNECTION FOR USER: None
  &lt;10.10.10.2&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/user/.ansible/cp/ansible-ssh-%h-%p-%r -tt 10.10.10.2 '/bin/sh -c '"'"'( umask 22 &amp;&amp; mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1464541230.33-190582391613085 `" &amp;&amp; echo "` echo $HOME/.ansible/tmp/ansible-tmp-1464541230.33-190582391613085 `" )'"'"''
  &lt;10.10.10.2&gt; PUT /tmp/tmpefUyS_ TO /home/user/.ansible/tmp/ansible-tmp-1464541230.33-190582391613085/setup
  &lt;10.10.10.2&gt; SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/user/.ansible/cp/ansible-ssh-%h-%p-%r '[10.10.10.2]'
  &lt;10.10.10.2&gt; ESTABLISH SSH CONNECTION FOR USER: None
  &lt;10.10.10.2&gt; SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/user/.ansible/cp/ansible-ssh-%h-%p-%r -tt 10.10.10.2 '/bin/sh -c '"'"'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/user/.ansible/tmp/ansible-tmp-1464541230.33-190582391613085/setup; rm -rf "/home/user/.ansible/tmp/ansible-tmp-1464541230.33-190582391613085/" &gt; /dev/null 2&gt;&amp;1'"'"''
  10.10.10.2 | FAILED! =&gt; {
      "changed": false, 
      "failed": true, 
      "invocation": {
          "module_name": "setup"
      }, 
      "module_stderr": "OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014\r\ndebug1: Reading configuration data /home/user/.ssh/config\r\ndebug1: /home/user/.ssh/config line 1: Applying options for *\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 2079\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to 10.10.10.2 closed.\r\n", 
      "module_stdout": "Traceback (most recent call last):\r\n  File \"/home/user/.ansible/tmp/ansible-tmp-1464541230.33-190582391613085/setup\", line 5184, in &lt;module&gt;\r\n    main()\r\n  File \"/home/user/.ansible/tmp/ansible-tmp-1464541230.33-190582391613085/setup\", line 140, in main\r\n    data = run_setup(module)\r\n  File \"/home/user/.ansible/tmp/ansible-tmp-1464541230.33-190582391613085/setup\", line 84, in run_setup\r\n    facts = ansible_facts(module)\r\n  File \"/home/user/.ansible/tmp/ansible-tmp-1464541230.33-190582391613085/setup\", line 5119, in ansible_facts\r\n    facts.update(Facts().populate())\r\n  File \"/home/user/.ansible/tmp/ansible-tmp-1464541230.33-190582391613085/setup\", line 2259, in __init__\r\n    self.get_platform_facts()\r\n  File \"/home/user/.ansible/tmp/ansible-tmp-1464541230.33-190582391613085/setup\", line 2305, in get_platform_facts\r\n    self.get_distribution_facts()\r\n  File \"/home/user/.ansible/tmp/ansible-tmp-1464541230.33-190582391613085/setup\", line 2459, in get_distribution_facts\r\n    if 'Red Hat' in data:\r\nTypeError: argument of type 'NoneType' is not iterable\r\n", 
      "msg": "MODULE FAILURE", 
      "parsed": false
  }
  </code></pre>
  
  <p>System:</p>
  
  <pre><code>    Linux host-01 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08   UTC 2014 x86_64 x86_64 x86_64 GNU/Linu
  </code></pre>
  
  <p>And on the same neighbor host everything works well </p>
  
  <p>The <code>"module_stdout"</code> traceback when formatted looks like this:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/home/user/.ansible/tmp/.../setup", line 5184, in &lt;module&gt;
      main()
    File "/home/user/.ansible/tmp/.../setup", line 140, in main
      data = run_setup(module)
    File "/home/user/.ansible/tmp/.../setup", line 84, in run_setup
      facts = ansible_facts(module)
    File "/home/user/.ansible/tmp/.../setup", line 5119, in ansible_facts
      facts.update(Facts().populate())
    File "/home/user/.ansible/tmp/.../setup", line 2259, in __init__
      self.get_platform_facts()
    File "/home/user/.ansible/tmp/.../setup", line 2305, in get_platform_facts
      self.get_distribution_facts()
    File "/home/user/.ansible/tmp/.../setup", line 2459, in get_distribution_facts
      if 'Red Hat' in data:
  TypeError: argument of type 'NoneType' is not iterable
  </code></pre>
  
  <p>upd: it working with -become param, but one strange thing:</p>
  
  <pre><code>user@host:~  &gt;&gt; ansible -vvvv -i "10.10.10.2," all -m setup -become | grep -i distr
          "ansible_distribution": "RedHat", 
          "ansible_distribution_major_version": "14", 
          "ansible_distribution_release": "trusty", 
          "ansible_distribution_version": "14.04", 
          "facter_lsbdistrelease": "14.04", 
          "facter_lsbmajdistrelease": "14",
  </code></pre>
  
  <p>ansible_distribution: RedHat, but it is Ubuntu 14.04.4</p>