Skip to content

Instantly share code, notes, and snippets.

Created April 25, 2017 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/2ae3dc427ec16830f47bbb9f6493fb1f to your computer and use it in GitHub Desktop.
Save anonymous/2ae3dc427ec16830f47bbb9f6493fb1f to your computer and use it in GitHub Desktop.
{%- for user, commands in pillar.get('nopass_sections', {} ).items() %}
{%- for command in commands %}
{{ user }} ALL=(ALL) NOPASSWD: {{ command }}
{%- endfor %}
{%- endfor %}
@gtmanfred
Copy link

You should be able to use

{{commands|join(', ')}}

instead of the for loop for commands.

iirc sudo allows for multiple commands there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment