# How to do best organization of install and delete in the same ansible playbook?

**URL:** <https://forum.ansible.com/t/how-to-do-best-organization-of-install-and-delete-in-the-same-ansible-playbook/17701>\
**Category:** Ansible Project\
**Created:** [March 9, 2015, 3:01pm UTC](https://forum.ansible.com/t/how-to-do-best-organization-of-install-and-delete-in-the-same-ansible-playbook/17701 "2015-03-09T15:01:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Valeriy\_Solovyov](https://avatars.discourse-cdn.com/v4/letter/v/8e8cbc/32.png) [@Valeriy\_Solovyov](https://forum.ansible.com/u/Valeriy_Solovyov)\
**Post date:** [March 9, 2015, 3:01pm UTC](https://forum.ansible.com/t/how-to-do-best-organization-of-install-and-delete-in-the-same-ansible-playbook/17701/1 "2015-03-09T15:01:04Z")

</div>

Hello,  
I try to figure how I must to construct an ansible playbooks with install/delete commands where it’s variable changes.  
For example apt\_repository,apt,yum… where state=present → installed and state=absent → deleted

If I create two ansible playbooks: delete.yml and install.yml. There are may be problem’s like:  
I added to installation someting, but don’t change deletion

Example:

install.yml:
