Skip to content

Instantly share code, notes, and snippets.

Created April 18, 2017 20:01
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/d1e57fc641023f148e539c42b32d6d32 to your computer and use it in GitHub Desktop.
Save anonymous/d1e57fc641023f148e539c42b32d6d32 to your computer and use it in GitHub Desktop.
orchestration state
salt-run command:
salt-run state.orch orch.setup pillar='{"data_set": {"target_host": "minionc-01.cook.book","sudo_users": ["joe"]}}'
snip of orch.setup state
{% set data_set = salt['pillar.get']('data_set') %}
{% set errors = [] %}
{% set minion_id = data_set['target_host'] %}
{% set s_users = data_set['sudo_users'].extend(("user1","user2")) %}
...
"run highstate":
salt.state:
- tgt: {{ minion_id }}
- highstate: True
- tgt_type: list
- pillar:
{{ minion_id }}:
lookup:
sudo_users: {{ s_users }}
sssd_conf:
ldap_filter: '(|(host=allunix)(host={{ minion_id }}){% for u in s_users %}(uid={{ u }}){% endfor %})
ERROR on sudo state
ID: sudoers_users
Function: group.present
Name: wheel
Result: False
Comment: The following group attributes are set to be changed:
addusers: ['N', 'o', 'n', 'e']
Some changes could not be applied
Started: 15:54:58.815480
Duration: 46.022 ms
Changes:
----------
Failed:
----------
addusers:
- N
- o
- n
- e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment