request vars_prompt feature?

Hi,

I would like to have a feature that you will only prompted by vars if you need them.

For example when I create vhost on a webserver I sometimes need databases and sometimes not.

So I have an ansible-playbook that will prompt for variables like

  • domainname
  • need database [yes/no]
  • database name
  • database deamon password

I would nice to have a feature ,when you prompt that you don’t want to have a db and answer with no, that ansible won’t prompt for the other vars.

I know there could be a possibility to do this when you include the create-db-playbook if you typed yes at the need database. But I guess that will prompt for the vars when it will be invoked. But if you have large for “everything” and just want to type some vars you need at the beginning and let ansible do the work. That would be great.

Am I going wrong ? What do you think about such a feature?

vars_prompt is mostly there for sensitive passwords and release
versions on push scripts.

I don't see us becoming a conditional prompting state machine as the
focus should be on automation.

If you want to feed variables in that are not in the playbook
--extra-args (-e) is a great solution for that.

You should always try to put these in non-prompted variables whenever
possible as that makes things repeatable.