I tend to take the template route almost all the time. This is in regard to
modifying JSON-based configuration files. I compose several roles and run
them against a host. Each role might do something very distinct, while they
all modify a common configuration file or add information to a meta-data
file. Since I have several roles none of which know about one-another, yet
all need to add some relevant data to a common JSON-based configuration
file, it would be convenient to edit this data directly since there's
really no single role from where I can define a master template.
On Thursday, July 31, 2014 5:41:30 PM UTC-4, Michael DeHaan wrote:
>
> I'm assuming this was a request to replace some keys inside of them.
>
> In most cases yes, if you have a datastructure defined in Ansible - and
> ansible can read almost any data file as JSON instead of YAML too - not
> that this matters,
>
> {{ datastructure }}
>
> is all the template needs to be.
>
> I was assuming this was about config file changes, but if you can use a
> template, it's better to fully declare the desired end result 99.999% of
> the time. Good point.
>
>
> On Thu, Jul 31, 2014 at 5:39 PM, Brian Coca <[email protected]
> <javascript:>> wrote:
>
>> its soooo easy to write json with jinja templates.
>>
>> --
>> 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] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CADn%2BHszHr%2BoFQb1Oreu1MP7OoT_SRvHdjfMU9uAai7n-FQKDdA%40mail.gmail.com
>>
>> <https://groups.google.com/d/msgid/ansible-project/CADn%2BHszHr%2BoFQb1Oreu1MP7OoT_SRvHdjfMU9uAai7n-FQKDdA%40mail.gmail.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/d476b013-d400-4e8a-8718-b79f6406a389%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.