How do you store login info only once?

33 views
Skip to first unread message

Hagai Kariti

unread,
Sep 9, 2014, 6:55:50 AM9/9/14
to ansible...@googlegroups.com
Hi all
I have a pattern question. Let's say I use ansible to both provision a server (RabbitMQ in my case) and to deploy an application that will connect to that server. Of course I save the login info in a vaulted group_vars file.
However, since the server and the application run on different servers and are on different hostgroups, I need to save the login info twice - once in the rabbit group_var and once in the app group_var.

There are several ways to solve this - I can put it once in the `all' group, create a 3rd hostgroup for 'rabbitmq related' servers, put the login info in an external file and include that... Any preference you guys have?

Thanks!

Michael DeHaan

unread,
Sep 9, 2014, 12:46:11 PM9/9/14
to ansible...@googlegroups.com
The larger group could work.   vars_files could be a good thing too.

vars_files:
   - rabbit_login_info.yml

etc

I tend to use group_vars pretty heavily, because they are automatically loaded.





--
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/e09ca997-2005-4db6-8376-0131c317c367%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hagai Kariti

unread,
Sep 9, 2014, 12:52:43 PM9/9/14
to ansible...@googlegroups.com

Yeah I prefer groupvars for that reason too. I just put it in the 'all' group for now, felt less cumbersome than dealing with static group relations.
Thanks for the reply :-)

You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/FfmAD-qBro4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.

To post to this group, send email to ansible...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages