Hi list,

working on my formula [0] for the Radicale CalDAV/CardDAV-server [1]
I just wondered:
   Should I rather gather configuration data from pillar inside the
   template for a configuration file
   should I pass them via defaults in the file.managed state so it's
   easier to see how the whole thing works when looking at the states?

After all, the first point in the Best Practices' General Rules [2] is
"Modularity and clarity should be emphasized whenever possible."

What do you think?

Regards, Florian

PS: The state in question:

{% if salt['grains.get']('os') == 'Ubuntu' -%}
# Uses pillar['radicale:disabled'] and pillar[radicale:verbose_init]
# (Defaulting to False and True, respectively)
     src: salt://radicale/etc_default_radicale.jinja
     template: jinja
{%- endif %}


{% if salt['grains.get']('os') == 'Ubuntu' -%}
     src: salt://radicale/etc_default_radicale.jinja
     template: jinja
       disabled: {{ salt['pillar.get']('radicale:disabled',False) }}
       verbose_init: {{ salt['pillar.get']('radicale:verbose_init',True) }}
{%- endif %}

I prefer the later one as it's more obvious what happens.

PPS: Yeah, I know, I should move templates for files to

[0] https://github.com/0xf10e/radicale-formula
[1] http://radicale.org

You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupsalt-users @
postedSep 25, '14 at 11:17a
activeSep 25, '14 at 11:17a

1 user in discussion

Florian Ermisch: 1 post



site design / logo © 2023 Grokbase