You can still define variables in a group_vars/development and group_vars/production and so on so developers won't need to define them.
I'm suggesting not defining them at two different levels of depth,which makes things inconsistent. On Sun, Oct 5, 2014 at 2:12 PM, Strahinja Kustudić <[email protected]> wrote: > But why not make it easier to install postgres for at least one > environment? Why require a variable to be set, if postgres can be installed > and configured without passing any variable as in this case? > > When I talk about development environment I'm mostly talking about devs > using virtual machines on their workstations and using Ansible to configure > those VMs. We don't have predefined variables for those virtual machines, > they are not on the repository, so they would need to set those variables > every time. > > On Sunday, October 5, 2014 7:59:51 PM UTC+2, Michael DeHaan wrote: >> >> I'd suggest setting them for neither and letting them be required. >> >> Role defaults are for if you don't pass any variables into the role. >> >> If there is something about them that comes from inventory, inventory >> will override those defaults. >> >> As such, you should set values for those inventory variables in both >> environments. >> >> >> On Sun, Oct 5, 2014 at 12:49 PM, Strahinja Kustudić <[email protected]> >> wrote: >> >>> I'm currently working on some roles and I'm not sure is it better to set >>> role defaults so that they are development friendly, or production friendly. >>> >>> Let me give you an example, so that you can understand what I mean. A >>> postgres role needs to configure pg_hba.conf file which would in production >>> (without setting any additional variables) look something like this: >>> >>> local all all peer map >>> =users >>> host all all 127.0.0.1/32 md5 >>> host all all ::1/128 md5 >>> >>> while in development it would like something like this: >>> >>> local all all trust >>> host all all 127.0.0.1/32 trust >>> host all all ::1/128 trust >>> >>> Pros and cons for each of these are the same. If defaults are set for >>> production, it is harder to setup dev environment, and the other way >>> around. If you set them for dev, you need to be more careful when >>> provisioning production servers, since you need to set more variables. How >>> do you set defaults for your roles? >>> >>> -- >>> 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 [email protected]. >>> To post to this group, send email to [email protected]. >>> To view this discussion on the web visit https://groups.google.com/d/ >>> msgid/ansible-project/f88e3b66-bf83-4370-89ed- >>> 522568f69ba4%40googlegroups.com >>> <https://groups.google.com/d/msgid/ansible-project/f88e3b66-bf83-4370-89ed-522568f69ba4%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- > 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 [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/eafbc097-61ad-45d4-a262-c43125640f13%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/eafbc097-61ad-45d4-a262-c43125640f13%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgza2doBuSw5vD36dsPS3qik3XeSFibfo2WZ%2B%2Bvk4cPJYA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
