Salt: Difference between revisions

From DWIKI
Line 49: Line 49:
==Rendering SLS 'base:roles.foo.bar' failed: Jinja variable 'dict object' has no attribute 'blergh'==
==Rendering SLS 'base:roles.foo.bar' failed: Jinja variable 'dict object' has no attribute 'blergh'==
Unless you made a typo, your minion probably doesn't have access in pillar
Unless you made a typo, your minion probably doesn't have access in pillar
==multiple parameters==
salt '*' param1,param2 arg1,arg2

Revision as of 07:52, 11 August 2016

Salt Configuration Management

Links

Tools

Writing custom state modules

Syntax checking etc:

python -m py__compile mymodule.py
saltutil.sync_states

FAQ

Add minion to master

single line per minion

salt "*" grains.item nodename group os osrelease --out=txt

(for a list of items use grains.items

Apply just one part of role

Assuming you have foo.sls in roles/

salt '*' state.apply roles.myrole.foo

Change minion hostname

On minion:

  • hostname new.host.name
  • update /etc/hostname
  • update /etc/salt/minion_id
  • restart salt-minion

On master: rename the key ( /srv/salt/pki/master/minions/old.host.name )

Rendering SLS 'base:roles.foo.bar' failed: Jinja variable 'dict object' has no attribute 'blergh'

Unless you made a typo, your minion probably doesn't have access in pillar

multiple parameters

salt '*' param1,param2 arg1,arg2