0

When using salt for specifying user creation, it is unorganized to have the for statement in a single line. Example:

{% for USR in 'hewey','dewey','loui' %}

Is it possible to break this into separate lines like:

{% for USR in %}
{% 'hewey', %}
{% 'dewey', %}
{% 'loui' %}

I'm unable to find anything about this with Google Fu.

David
  • 1

1 Answers1

0

{% for USR in 'hewey','dewey','loui' %}

I'm not even sure this works, but this

{% for USR in ['hewey','dewey','loui'] %}

should.

Answering your 'format' question, I don't think it's possible (and even desirable). If you want to create users from a list of 'names' you should use pillar to inject this data. It will allow you to separate processing (create users) from data (hewey, dewey, loui).

You can start reading Getting Started Tutorial and this page about pillar https://docs.saltstack.com/en/getstarted/config/pillar.html

daks
  • 673
  • 6
  • 23