# Galaxy and a Feature Idea for remembering values passed to vars\_prompt

**URL:** <https://forum.ansible.com/t/galaxy-and-a-feature-idea-for-remembering-values-passed-to-vars-prompt/13770>\
**Category:** Ansible Project\
**Tags:** galaxy-ng\
**Created:** [October 25, 2013, 5:20pm UTC](https://forum.ansible.com/t/galaxy-and-a-feature-idea-for-remembering-values-passed-to-vars-prompt/13770 "2013-10-25T17:20:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brice\_Burgess](https://avatars.discourse-cdn.com/v4/letter/b/d2c977/32.png) [@Brice\_Burgess](https://forum.ansible.com/u/Brice_Burgess)\
**Post date:** [October 25, 2013, 5:20pm UTC](https://forum.ansible.com/t/galaxy-and-a-feature-idea-for-remembering-values-passed-to-vars-prompt/13770/1 "2013-10-25T17:20:15Z")

</div>

I was very excited to learn about the Ansible crew’s intention for Galaxy; kind of a marketplace for re-usable roles from what I understand. This can be very successful and useful, and I’m looking forward to see what standards form around it.

Personally I’ve been working on an ansible “framework” with a focus on convention and avoiding redundant code (e.g. all applications share a common “application” role, services a “service” role, and systems/machines a “system” role). The common roles provide boiler plate wiring (e.g. vars, handlers, and task workflow) that instills the convention and reduces redundancy. Everything is separated via tags into either a “prepare” phase, and a “deploy” phase.

Anyway; as part of this we also have written playbooks that generate new (application) roles, handling the tie-in with the common role functionality. In the past we used shell scripts to aid in the creation and execution of playbooks. A big part of this was to remember values passed to playbooks via --extra-vars…

[TL;DR]  
I thought it would be nice to do entirely away with complicated shell scripts; and to extend ansible’s vars\_prompt functionality with the ability to remember values that were passed in to prompted variable. It could be as feature-full as a history (allowing up, down arrow keys to cycle through history), or as simple as leaving the value blank to use the last value. Any consensus around this?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [October 25, 2013, 11:51pm UTC](https://forum.ansible.com/t/galaxy-and-a-feature-idea-for-remembering-values-passed-to-vars-prompt/13770/2 "2013-10-25T23:51:17Z")

</div>

Playbooks to generate roles feels a bit too meta to me (or too inverted), unless I’m misunderstanding the purpose.

I will say Ansible when Galaxy comes out will have a CLI command to generate the scaffolding of a new role, but you seem to be discussing something a bit deeper?

Help me understand more perhaps?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [October 25, 2013, 11:52pm UTC](https://forum.ansible.com/t/galaxy-and-a-feature-idea-for-remembering-values-passed-to-vars-prompt/13770/3 "2013-10-25T23:52:02Z")

</div>

Also to be clear, Galaxy content is going to be 100% free.

But yeah, you can think of it as an iTunes or BeerAdvocate for Ansible role content, backed heavily by github, with a package manager for getting beer^W roles.

---

<div class="post-metadata">

**Author:** ![Brice\_Burgess](https://avatars.discourse-cdn.com/v4/letter/b/d2c977/32.png) [@Brice\_Burgess](https://forum.ansible.com/u/Brice_Burgess)\
**Post date:** [October 26, 2013, 3:28am UTC](https://forum.ansible.com/t/galaxy-and-a-feature-idea-for-remembering-values-passed-to-vars-prompt/13770/4 "2013-10-26T03:28:48Z")

</div>

> Playbooks to generate roles feels a bit too meta to me (or too inverted), unless I’m misunderstanding the purpose.

Roles consist of a ton of boiler plate code; e.g.

mkdir -p roles/$role/tasks roles/$role/vars roles/$role/handlers

template-out tasks:/roles/$role/tasks/main.yml  
template-out vars:/roles/$role/vars/main.yml

etc. etc.

All I am saying is I use an ansible playbook to create strucute and populate according to vars that I prompt for. Think it’s natural for this so we all speak “1 language”.

My feature idea was to have interactive history added to prompted for by `vars_prompt`

---

<div class="post-metadata">

**Author:** ![Brice\_Burgess](https://avatars.discourse-cdn.com/v4/letter/b/d2c977/32.png) [@Brice\_Burgess](https://forum.ansible.com/u/Brice_Burgess)\
**Post date:** [October 26, 2013, 3:35am UTC](https://forum.ansible.com/t/galaxy-and-a-feature-idea-for-remembering-values-passed-to-vars-prompt/13770/5 "2013-10-26T03:35:40Z")

</div>

> But yeah, you can think of it as an iTunes or BeerAdvocate for Ansible role content, backed heavily by github, with a package manager for getting beer^W roles.

Good thing it’s winter and we can now move to stouts… Saison’s doing the damage 😉 !

We talking GPL or BSD role content?

---

<div class="post-metadata">

**Author:** ![James\_Cammarata1](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@James\_Cammarata1](https://forum.ansible.com/u/James_Cammarata1)\
**Post date:** [October 26, 2013, 11:48am UTC](https://forum.ansible.com/t/galaxy-and-a-feature-idea-for-remembering-values-passed-to-vars-prompt/13770/6 "2013-10-26T11:48:20Z")

</div>

Since roles are mostly content, I was figuring a CC- license would be more appropriate, but there is a field in the metadata for specifying the license.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [October 26, 2013, 3:26pm UTC](https://forum.ansible.com/t/galaxy-and-a-feature-idea-for-remembering-values-passed-to-vars-prompt/13770/7 "2013-10-26T15:26:50Z")

</div>

“My feature idea was to have interactive history added to prompted for by `vars_prompt`”

I’ll say right now that I’m not going to add this, lots of people would _not_ want this history, and vars\_prompt can be used to prompt for sensitive items. Seems like a lot of code for something not many would use.

You could of course implement your own by way of a lookup plugin that only runs against localhost.
