# Tidy module

**URL:** <https://forum.ansible.com/t/tidy-module/15455>\
**Category:** Ansible Developer\
**Created:** [June 12, 2014, 6:01pm UTC](https://forum.ansible.com/t/tidy-module/15455 "2014-06-12T18:01:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruggero\_Marchei](https://avatars.discourse-cdn.com/v4/letter/r/dfb087/32.png) [@Ruggero\_Marchei](https://forum.ansible.com/u/Ruggero_Marchei)\
**Post date:** [June 12, 2014, 6:01pm UTC](https://forum.ansible.com/t/tidy-module/15455/1 "2014-06-12T18:01:54Z")

</div>

Hi guys,

I’ve created a “tidy” module for Ansible (module useful to remove unwanted files based on specific criteria) and I would like to have an opinion about that.  
Any comment or suggestion is really appreciated!

You can check it here: [https://github.com/rmarchei/ansible-tidy](https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Frmarchei%2Fansible-tidy&sa=D&sntz=1&usg=AFQjCNGBOYQScL4uODy1ZJu_UQGmWwiiGQ)

Thank you!

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [June 13, 2014, 2:26am UTC](https://forum.ansible.com/t/tidy-module/15455/2 "2014-06-13T02:26:40Z")

</div>

Looks very interesting!

How about submitting it as a pull request?

We’d love to have it.

---

<div class="post-metadata">

**Author:** ![Mark\_Copley](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@Mark\_Copley](https://forum.ansible.com/u/Mark_Copley)\
**Post date:** [June 13, 2014, 3:16am UTC](https://forum.ansible.com/t/tidy-module/15455/3 "2014-06-13T03:16:02Z")

</div>

Hi, I’m just getting starting writing custom modules from ansibles and yours looks like  
a great example to learn from. One thing I noticed when I cloned your repository and  
installed tidy into /usr/share/ansible/system is that the documentation string seems to  
have some problems in the parsing

when I run ansible-doc tidy I keep getting errors from several of the description strings  
that had line break in them. I changed those to have no line breaks and eliminated those  
errors but even after that I still get the traceback:

Traceback (most recent call last):  
File “/usr/bin/ansible-doc”, line 286, in   
main()  
File “/usr/bin/ansible-doc”, line 278, in main  
text += get\_man\_text(doc)  
File “/usr/bin/ansible-doc”, line 111, in get\_man\_text  
desc = “”.join(opt[‘description’])  
TypeError: sequence item 0: expected string, dict found

when I run ansible-doc tidy

I ran the documentation (with the fixed description strings) through a YAML validator and it  
said it was now valid YAML so I’m sure what what’s at this point.

Anyway, the module itself appears to work just as advertised so thanks for sharing your  
code and hopefully the documentation string issue isn’t too difficult to resolve

Cheers!  
Mark

---

<div class="post-metadata">

**Author:** ![Ruggero\_Marchei](https://avatars.discourse-cdn.com/v4/letter/r/dfb087/32.png) [@Ruggero\_Marchei](https://forum.ansible.com/u/Ruggero_Marchei)\
**Post date:** [June 13, 2014, 6:09am UTC](https://forum.ansible.com/t/tidy-module/15455/4 "2014-06-13T06:09:05Z")

</div>

Thank you Michael and Mark,

the documentation string should be fixed, if you want you can check it now.

I’ll wait a little more and if there aren’t other comments I’ll send a pull request.

Thanks again!

---

<div class="post-metadata">

**Author:** ![Ruggero\_Marchei](https://avatars.discourse-cdn.com/v4/letter/r/dfb087/32.png) [@Ruggero\_Marchei](https://forum.ansible.com/u/Ruggero_Marchei)\
**Post date:** [June 13, 2014, 10:07am UTC](https://forum.ansible.com/t/tidy-module/15455/5 "2014-06-13T10:07:14Z")

</div>

Pull request submitted: [https://github.com/ansible/ansible/pull/7753](https://github.com/ansible/ansible/pull/7753)

---

<div class="post-metadata">

**Author:** ![Mark\_Copley](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@Mark\_Copley](https://forum.ansible.com/u/Mark_Copley)\
**Post date:** [June 13, 2014, 4:38pm UTC](https://forum.ansible.com/t/tidy-module/15455/6 "2014-06-13T16:38:05Z")

</div>

New comments look great in ansible-doc command - glad I could contribute a little!

Mark
