title: Ansible "Unexpected failure during module execution" error
body: <h2>1. Host file contents</h2>
  
  <pre><code>[droplets]
  host1 ansible_ssh_host=&lt;IP1&gt;
  </code></pre>
  
  <h2>2. /etc/ansible/ansible.cfg contents:</h2>
  
  <pre><code>inventory      = /etc/ansible/hosts
  </code></pre>
  
  <h2>3. /etc/ansible/group_vars/droplets contents:</h2>
  
  <pre><code>---
  ansible_ssh_user: admin
  </code></pre>
  
  <h2>4. Log on running the following command:</h2>
  
  <pre><code>$ ansible -m ping host1 -vvv
  </code></pre>
  
  <p>Ansible 2.4.1.0</p>
  
  <hr>
  
  <p>config file = /etc/ansible/ansible.cfg</p>
  
  <blockquote>
    <p>File "/usr/lib/python2.7/os.py", line 157, in makedirs<br>
     mkdir(name, mode)<br>
    OSError: [Errno 13] Permission denied: '~'</p>
  </blockquote>
  
  <pre><code>host1 | FAILED! =&gt; {
    "failed": true, 
    "msg": "Unexpected failure during module execution.", 
    "stdout": ""
  }
  </code></pre>
  
  <p>Appreciate if someone could help on this?</p>
  
  <p>Thanks.</p>