From 5a8c75574e7db7ee5c7c91556ae661a346956c0f Mon Sep 17 00:00:00 2001 From: merlinz01 <158784988+merlinz01@users.noreply.github.com> Date: Tue, 23 Apr 2024 19:13:38 -0400 Subject: [PATCH] add example of using slots to populate env vars from pillar --- salt/states/cmd.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/salt/states/cmd.py b/salt/states/cmd.py index df0aec96ef8..f99db2562f1 100644 --- a/salt/states/cmd.py +++ b/salt/states/cmd.py @@ -229,6 +229,14 @@ To use it, one may pass it like this. Example: cmd.run: - env: {{ salt['pillar.get']('example:key', {}) }} +Better yet, use the slots feature to insert the data at runtime and minimize pillar data exposure: + +.. code-block:: yaml + + printenv: + cmd.run: + - env: __slot__:salt:pillar.get(example:key) + """ import copy