# Nice alternative to 'tags' for restricting change scope in a playbook

**URL:** <https://forum.ansible.com/t/nice-alternative-to-tags-for-restricting-change-scope-in-a-playbook/17272>\
**Category:** Ansible Project\
**Created:** [January 14, 2015, 7:13pm UTC](https://forum.ansible.com/t/nice-alternative-to-tags-for-restricting-change-scope-in-a-playbook/17272 "2015-01-14T19:13:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Russell\_Briggs](https://avatars.discourse-cdn.com/v4/letter/r/9de0a6/32.png) [@Russell\_Briggs](https://forum.ansible.com/u/Russell_Briggs)\
**Post date:** [January 14, 2015, 7:13pm UTC](https://forum.ansible.com/t/nice-alternative-to-tags-for-restricting-change-scope-in-a-playbook/17272/1 "2015-01-14T19:13:15Z")

</div>

Hi All

First off, I LOVE ansible, its awesome! Really didn’t like puppet when I tried it.

Just wanted to share a nice pattern I found for making it easy to run only part of a playbook, without having to remember which tags to use with the --tags option. (apologies if something similar has been posted before!)

With the below code at the top of the playbook, when you run it with ansible-playbook, you are first presented with an options menu asking you what you want to do 🙂

- name: My awesome playbook with options menu 🙂

vars\_prompt:  
update\_option: |  
This playbook updates LIVE SYSTEMS. Use with caution!

Please enter one of the following options to perform the update:  
app\_update - check / update application software only  
nginx - check / update nginx configuration  
backup - check / update backup configuration  
all - check / update all items

Or press CTRL+C to Cancel!

roles:

- { role: my\_app\_role, when: “update\_option in [‘app\_update’, ‘all’]” }
- { role: my\_app\_other\_role, when: “update\_option in [‘app\_update’, ‘all’]” }
- { role: nginx, when: “update\_option in [‘nginx’, ‘all’]” }
- { role: app\_backup, when: “update\_option in [‘backup’, ‘all’]” }

Cheers all!

Russell Briggs  
(Junari Ltd)
