Skip to content

Instantly share code, notes, and snippets.

@Karunamon
Last active February 9, 2016 16:08
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 Karunamon/ff9b51886cc9d8bfcbbd to your computer and use it in GitHub Desktop.
Save Karunamon/ff9b51886cc9d8bfcbbd to your computer and use it in GitHub Desktop.
initial_highstate:
salt.state:
- tgt: 'app:myapp'
- tgt_type: grain
- highstate: True
run_upgrade:
salt.state:
- tgt: 'G@app:myapp and not G@app_role:database'
- tgt_type: compound
- sls:
- app_upgrade
#salt-run state.orchestrate myapp.myapp_orch test=True
#[ERROR ] An exception occurred in this state: Traceback (most recent call last):
# File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1594, in call
# **cdata['kwargs'])
# File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1491, in wrapper
# return f(*args, **kwargs)
# File "/usr/lib/python2.7/dist-packages/salt/states/saltmod.py", line 259, in state
# for state_item in six.itervalues(m_ret):
# File "/usr/lib/python2.7/dist-packages/salt/ext/six.py", line 580, in itervalues
# return iter(d.itervalues(**kw))
#AttributeError: 'list' object has no attribute 'itervalues'
#saltmstr.example.com_master:
# Name: initial_highstate - Function: salt.state - Result: Clean
# Name: run_upgrade - Function: salt.state - Result: Failed
#
#Summary for saltmstr.example.com_master
#------------
#Succeeded: 1
#Failed: 1
#------------
#Total states run: 2
#Total run time: 8.705 s
@jfindlay
Copy link

jfindlay commented Feb 8, 2016

@Karunamon, don't you need a G@ on line 3?

@Karunamon
Copy link
Author

@jfindlay I don't think so - as far as I know, that syntax is only used when tgt_type is compound.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment