Re: [salt-users] Using values from different pillar environment in a state

14 views
Skip to first unread message

Phipps, Thomas

unread,
Mar 5, 2025, 1:30:24 PMMar 5
to salt-...@googlegroups.com
the minion only keeps one copy of the pillar in memory.


I will note that this will ask for a fresh copy of the pillar with every SWITCH in env ... and this can be VERY slow and can trash your masters communication if you often switch between envs.

so it is possible. just not wise.

On Wed, Mar 5, 2025 at 4:19 AM DD <dim...@gmail.com> wrote:
Hi,

I have the following folder structure in my pillar
pillar:
  cut:
    my_test:
      init.sls
  dev:
    my_test:
      init.sls

and i want to use in my state variables from the both (cut a dev) environments.
Something like:
create_file:
  file.managed:
    - name: [salt['pillar.get']([saltenv, 'my_test', 'path']|join(':')), 'file_name']|join('/')

Is it possible to do? Is it possible assign environment names dynamically?

--
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 salt-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/salt-users/01637245-02a5-415c-9e3c-216478d9c889n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages