Closed noelmcloughlin closed 6 years ago
Something like this (but without failing the state) would be nice-
{% for group in user.get('groups', []) %}
users_{{ name }}_{{ group }}_group:
cmd.run:
- name: getent group {{ name }}
- output_loglevel='quiet'
group.present:
- name: {{ group }}
{% if group == 'sudo' %}
- system: True
{% endif %}
- onfail:
- cmd: users_{{ name }}_{{ group }}_group
{% endfor %}
Is there any pillar to workaround ERRORS/failed states if users already exist? I want to ensure oracle user, and oracle/dba groups, are present in any database but salt only checks locally
(see also https://github.com/saltstack/salt/issues/45345 and https://github.com/saltstack/salt/issues/45142)
Thanks Noel