saltstack/salt — pull request #3028 by SEJeff (2012-12-27 04:44:16+00:00)
Title: Add 'user.list_users'

On my personal machines, my username is jeff. On my work machines, my username is jschroeder.

I want the ability to setup ~${USER}/git/salt checkouts via salt states. I've not written the state just yet, but I want to do something akin to:

```jinja
{% if 'jeff' in salt['user.list_users'] %}
{% set user = 'jeff' %}
{% elsif 'jschroeder' in salt['list_users'] %}
{% set user = 'jschroeder'
{% else %}
{% set user = None %}
{% endif %}

{% if user %}
do_git_checkout to /path/{{ user }}/git/salt
{% endif %}
```

This is only for my user. I don't want to do this for every user especially at work, where hundreds of users (potentially) are stored in ldap.