<p dir="auto">Ansible Version - 2.0, 2.0.0.2<br>
Module - File<br>
Description - Trying to create directories more than 1 level deep gives following error:</p>
<p dir="auto">There was an issue creating /dir1/dir2 as requested: 'module' object has no attribute 'EEXISTS'</p>
<p dir="auto">If i remove dir2, it works. This command use to work with ansible version 1.9.2</p>
<h5 dir="auto">Issue Type:</h5>
<p dir="auto">Bug Report</p>
<h5 dir="auto">Component Name:</h5>
<p dir="auto">file module</p>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">Ansible devel</p>
<h5 dir="auto">Ansible Configuration:</h5>
<p dir="auto">Default <code class="notranslate">ansible.cfg</code></p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">Debian, Ubuntu, unprivileged account</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto"><code class="notranslate">file</code> module cannot create private directories with mode <code class="notranslate">0600</code> more than two levels deep.</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- hosts: all
  become: False

  tasks:

    - name: Create private directory
      file:
        path: '~/var/lib/private'
        state: 'directory'
        mode: '0600' "><pre class="notranslate"><code class="notranslate">- hosts: all
  become: False

  tasks:

    - name: Create private directory
      file:
        path: '~/var/lib/private'
        state: 'directory'
        mode: '0600' 
</code></pre></div>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">Directories are created without issues.</p>
<h5 dir="auto">Actual Results:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PLAY ***************************************************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [Create private directory] ************************************************
fatal: [localhost]: FAILED! =&gt; {&quot;changed&quot;: false, &quot;failed&quot;: true, &quot;msg&quot;: &quot;There was an issue creating /var/local/drybjed/var/lib/private as requested: 'module' object has no attribute 'EEXISTS'&quot;, &quot;path&quot;: &quot;/var/local/drybjed/var/lib/private&quot;, &quot;state&quot;: &quot;absent&quot;}

PLAY RECAP *********************************************************************
localhost                      : ok=1    changed=0    unreachable=0    failed=1   "><pre class="notranslate"><code class="notranslate">PLAY ***************************************************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [Create private directory] ************************************************
fatal: [localhost]: FAILED! =&gt; {"changed": false, "failed": true, "msg": "There was an issue creating /var/local/drybjed/var/lib/private as requested: 'module' object has no attribute 'EEXISTS'", "path": "/var/local/drybjed/var/lib/private", "state": "absent"}

PLAY RECAP *********************************************************************
localhost                      : ok=1    changed=0    unreachable=0    failed=1   
</code></pre></div>