Prompts from roles?

54 views
Skip to first unread message

Matt Hughes

unread,
Sep 30, 2014, 11:25:40 AM9/30/14
to ansible...@googlegroups.com
I know you can declare variables as part of a role:



└── wordpress-nginx
   
├── LICENSE.md
   
├── README.md
   
├── group_vars
   
  └── all
   
├── hosts.example
   
├── roles
   
  ├── common
   
    ├── files
   
      ├── RPM-GPG-KEY-EPEL-6
   
      ├── epel.repo
   
      └── iptables-save
   
    ├── handlers
   
      └── main.yml
        └── vars
   
        └── main.yml


but can you specify vars_prompts under a role as well?  I tried both vars_prompt/main.yml and prompts/main.yml but my ansible-playbook prompts me for neither.  Running with Ansible 1.7.2.

I have many playbooks that all share the same role.  The prompts are really specific to the role, not an individual playbook.

Brian Coca

unread,
Sep 30, 2014, 3:16:36 PM9/30/14
to ansible...@googlegroups.com
you can use the pause module to prompt for info and register a var
with the result var.user_input
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/d3d7811a-156c-48ab-a177-977527c0abfe%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Brian Coca
Stultorum infinitus est numerus
0110000101110010011001010110111000100111011101000010000001111001011011110111010100100000011100110110110101100001011100100111010000100001
Pedo mellon a minno
Reply all
Reply to author
Forward
0 new messages