# Ansible and purged resources

**URL:** <https://forum.ansible.com/t/ansible-and-purged-resources/29755>\
**Category:** Ansible Project\
**Created:** [February 23, 2019, 6:37pm UTC](https://forum.ansible.com/t/ansible-and-purged-resources/29755 "2019-02-23T18:37:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Klaus\_Ethgen](https://avatars.discourse-cdn.com/v4/letter/k/e0b2c6/32.png) [@Klaus\_Ethgen](https://forum.ansible.com/u/Klaus_Ethgen)\
**Post date:** [February 23, 2019, 6:37pm UTC](https://forum.ansible.com/t/ansible-and-purged-resources/29755/1 "2019-02-23T18:37:31Z")

</div>

Hi Folks,

I have used many configuration management systems in the past.

One of the greatest features was the purge value for resources in puppet  
that removes all \_unmanaged\_ resources of the type (file, user, ssh-Key,  
...)

Especially for security reasons that is an absolute need for some stuff.

I tried to implement that feature in ansible but the play looks really  
ugly. Further more, it could be archived in just a narrow  
implementation.

For ssh-authorized keys I use a template currently instead of  
authorized\_key.

But this all is incomplete as it does not allow to add resources in  
difference roles and purge all the unmanaged ones at the end.

Is there any idea about that?

-- Klaus
