title: Ansible: Changing permission of a directory issue
body: <p>I'm running the following Ansible task to change permission of a directory and its content.</p>
  
  <pre><code>- name: Change ownership of everything below /opt/as2/app-server
    file: path=/opt/as2/app-server state=directory recurse=yes owner=adrt group=adrt
  </code></pre>
  
  <p>When running it I get the following issue:</p>
  
  <blockquote>
    <p>TASK [appserver : Change ownership of everything below /opt/as2/app-server] ****<br>
    fatal: [192.168.1.182]: FAILED! => {"changed": false, "failed": true, "module_stderr": "", "module_stdout": "Traceback (most recent call last):\r\n  File \"/tmp/ansible_UrBo6x/ansible_module_file.py\", line 451, in \r\n    main()\r\n  File \"/tmp/ansible_UrBo6x/ansible_module_file.py\", line 335, in main\r\n    changed |= recursive_set_attributes(module, to_bytes(file_args['path'], errors='surrogate_or_strict'), follow, file_args)\r\n  File \"/tmp/ansible_UrBo6x/ansible_module_file.py\", line 146, in recursive_set_attributes\r\n    changed |= module.set_fs_attributes_if_different(tmp_file_args, changed)\r\n  File \"/tmp/ansible_UrBo6x/ansible_modlib.zip/ansible/module_utils/basic.py\", line 1163, in set_fs_attributes_if_different\r\n  File \"/tmp/ansible_UrBo6x/ansible_modlib.zip/ansible/module_utils/basic.py\", line 929, in set_owner_if_different\r\n  File \"/tmp/ansible_UrBo6x/ansible_modlib.zip/ansible/module_utils/basic.py\", line 842, in user_and_group\r\nOSError: [Errno 2] No such file or directory: '/opt/as2/app-server-1.0.0/apps/station/WEB-INF/classes/org/adroitlogic/isuite/metrics/As2MetricsService/usr/bin/python$tt__collectStats_closure14.class'\r\n", "msg": "MODULE FAILURE"}</p>
  </blockquote>
  
  <p>Basically it says there is no such file or directory as,</p>
  
  <pre><code>/opt/as2/app-server-1.0.0/apps/station/WEB-INF/classes/org/adroitlogic/isuite/metrics/As2MetricsService/usr/bin/python$tt__collectStats_closure14.class
  </code></pre>
  
  <p>The content of the directory, <code>/opt/as2/app-server/apps/station/WEB-INF/classes/org/adroitlogic/isuite/metrics/</code> is, </p>
  
  <pre><code>As2MetricsService$_$tt__CountStatisticsLists_closure3.class
  As2MetricsService$_$tt__collectStats_closure10.class
  As2MetricsService$_$tt__collectStats_closure11.class
  As2MetricsService$_$tt__collectStats_closure12.class
  As2MetricsService$_$tt__collectStats_closure13.class
  As2MetricsService$_$tt__collectStats_closure14.class
  As2MetricsService$_$tt__collectStats_closure15.class
  As2MetricsService$_$tt__collectStats_closure4.class
  As2MetricsService$_$tt__collectStats_closure5.class
  As2MetricsService$_$tt__collectStats_closure6.class
  As2MetricsService$_$tt__collectStats_closure7.class
  As2MetricsService$_$tt__collectStats_closure8.class
  As2MetricsService$_$tt__collectStats_closure9.class
  As2MetricsService$_CountStatisticsLists_closure1.class
  As2MetricsService$_collectStats_closure2.class
  As2MetricsService.class
  </code></pre>
  
  <p>There are no subdirectories.</p>
  
  <p>Also when I run the command <code>chown -R adrt:adrt .</code> inside the directory <code>/opt/as2/app-server</code> it executes without any issue.</p>
  
  <p>Help me to understand what is happening here.</p>