We have proposed changing this to something much less likely to be
clobbered.

If someone would like to file a ticket, or send a pull request to make this
automagic use a variable like "ansible_environment_settings" or something,
we'll definitely consider changing it.

This has come up a handful of times, and while documented, it would be nice
to not have the potential confusion.



On Tue, Sep 16, 2014 at 8:53 AM, José Moreira <[email protected]> wrote:

> Awesome, thank you!
>
> Terça-feira, 16 de Setembro de 2014 13:47:03 UTC+1, Matt Martz escreveu:
>>
>> The variable name "environment" is a reserved variable name and used as
>> described at http://docs.ansible.com/playbooks_environment.html
>>
>> You should use something such as "env" or "environ" instead.
>>
>> On Tue, Sep 16, 2014 at 7:36 AM, José Moreira <[email protected]> wrote:
>>
>>> Hello,
>>>
>>> my company (me) recently started using Ansible (1.7.1) for multi-stage
>>> server provisioning (both on local vagrant and ec2). Even though i haven't
>>> utilized the variable much, i have defined:
>>>
>>> environment: production
>>>
>>> on the environment specific group_vars file; its value can be
>>> "development", "production", "staging", etc. In the same group_vars file,
>>> for provisioning Postgresql databases i am utilizing the "ANXS.postgresql"
>>> Galaxy module and defining databases in variables as well:
>>>
>>> postgresql_databases:
>>>   - name: app_production
>>>     hstore: yes
>>>     uuid_ossp: no
>>>
>>> I had initially planned to suffix the environment variable in the
>>> database name (not only on databases but other sections of the playbooks) :
>>>
>>> postgresql_databases:
>>>   - name: app_{{ environment }}
>>>     hstore: yes
>>>     uuid_ossp: no
>>>
>>> but the resulting database name after substitution becomes "app_{}" and
>>> i believe it is related, but not only, to the database task using
>>> with_items:
>>>
>>> - name: PostgreSQL | Make sure the PostgreSQL databases are present
>>>   postgresql_db:
>>>     name: "{{item.name}}"
>>>     encoding: "{{postgresql_encoding}}"
>>>     lc_collate: "{{postgresql_locale}}"
>>>     lc_ctype: "{{postgresql_locale}}"
>>>     template: "template0"
>>>     state: present
>>>   with_items: postgresql_databases
>>>   when: postgresql_databases|length > 0
>>>
>>> Is it possible to use this substitution pattern (utilizing variables
>>> with other variables in its value as a list value), or am i just using the
>>> wrong pattern and just use explicit names (name_X instead of name_{{ var1
>>> }}) ?
>>>
>>> Thank you
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>  --
>>> 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/f867236c-8e63-4790-9b3a-
>>> ae5e0131c4bf%40googlegroups.com
>>> <https://groups.google.com/d/msgid/ansible-project/f867236c-8e63-4790-9b3a-ae5e0131c4bf%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Matt Martz
>> [email protected]
>> http://sivel.net/
>>
>  --
> 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/43b95102-934a-40b0-b4a8-0c61550bc476%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/43b95102-934a-40b0-b4a8-0c61550bc476%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%2BnsWgx21HD%3DKoao8H8%2Bh--KDHOZKn01dh7XotwqrutRErSJrw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to