title: Get sorted list of folders with Ansible
body: <p>I have <strong>OS X &quot;El capitan&quot; 10.11.6</strong> and I am using  <strong>Ansible 2.1.1.0</strong> to run some maintenance tasks on a remote Linux server <strong>Ubuntu 16.04 Xenial</strong>. I am trying to get the following list of folders sorted on the remote machine (Linux), so I can remove the old ones when needed:</p>
  <pre><code>/releases/0.0.0
  /releases/0.0.1
  /releases/0.0.10
  /releases/1.0.0
  /releases/1.0.5
  /releases/2.0.0
  </code></pre>
  <p>I have been trying with the module <a href="http://docs.ansible.com/ansible/find_module.html" rel="nofollow noreferrer">find</a> in Ansible, but it returns a not sorted list. Is there an easy way to achieve this with Ansible?</p>