Skip to content

Instantly share code, notes, and snippets.

@powellchristoph
Created August 17, 2015 15:16
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 powellchristoph/846b69bc39cd84ca5d5d to your computer and use it in GitHub Desktop.
Save powellchristoph/846b69bc39cd84ca5d5d to your computer and use it in GitHub Desktop.
# Contrived example. The main point is I want to give immediate
# feedback with the error.
# This would come from pillar
{% set users = ['joe', 'tim', 'bob'] %}
{% for user in users %}
{% if user != 'bob' %}
{{ user }}:
user.present:
- fullname: {{ user }}
- home: /home/{{ user }}
{% else %}
<Throw an error here, we don't allow bob as a username.>
{% endif %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment