Skip to content

Instantly share code, notes, and snippets.

@ksalman
Created June 30, 2014 15:44
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 ksalman/6e37c0d31a535f1ae7fe to your computer and use it in GitHub Desktop.
Save ksalman/6e37c0d31a535f1ae7fe to your computer and use it in GitHub Desktop.
reactor sync grains before highstate
sync_grains:
cmd.saltutil.sync_grains:
- tgt: {{ data['id'] }}
highstate_run:
cmd.state.highstate:
- tgt: {{ data['id'] }}
Event fired at Mon Jun 30 08:18:33 2014
*************************
Tag: 20140630081826490541
Data:
{'_stamp': '2014-06-30T08:18:33.161897',
'cmd': '_return',
'fun': 'saltutil.sync_grains',
'fun_args': [],
'id': 'localhost',
'jid': '20140630081826490541',
'retcode': 0,
'return': ['grains.ipv4', 'grains.os'],
'success': True}
Event fired at Mon Jun 30 08:18:33 2014
*************************
Tag: salt/job/20140630081826490541/ret/localhost
Data:
{'_stamp': '2014-06-30T08:18:33.162003',
'cmd': '_return',
'fun': 'saltutil.sync_grains',
'fun_args': [],
'id': 'localhost',
'jid': '20140630081826490541',
'retcode': 0,
'return': ['grains.ipv4', 'grains.os'],
'success': True}
Event fired at Mon Jun 30 08:18:34 2014
*************************
Tag: 20140630081826409545
Data:
{'_stamp': '2014-06-30T08:18:34.875562',
'cmd': '_return',
'fun': 'state.highstate',
'fun_args': [],
'id': 'localhost',
'jid': '20140630081826409545',
'out': 'highstate',
'retcode': 1,
'return': ['Rendering SLS "base:settings.minion" failed: Jinja variable \'dict\' object has no attribute \'ipv4_mgmt\'; line 15\n\n---\n[...]\n file.managed:\n - source: salt://se
ttings/minion/minion_id\n - template: jinja\n - context:\n {% if grains[\'fqdn\'].startswith("localhost") %}\n fqdn: {{ grains[\'ipv4_mgmt\'] }} <===============
=======\n {% else %}\n fqdn: {{ grains[\'fqdn\'] }}\n {% endif %}\n\n{% elif grains["os"] == "Windows" %}\n[...]\n---'],
'success': True}
Event fired at Mon Jun 30 08:18:34 2014
*************************
Tag: salt/job/20140630081826409545/ret/localhost
Data:
{'_stamp': '2014-06-30T08:18:34.875666',
'cmd': '_return',
'fun': 'state.highstate',
'fun_args': [],
'id': 'localhost',
'jid': '20140630081826409545',
'out': 'highstate',
'retcode': 1,
'return': ['Rendering SLS "base:settings.minion" failed: Jinja variable \'dict\' object has no attribute \'ipv4_mgmt\'; line 15\n\n---\n[...]\n file.managed:\n - source: salt://se
ttings/minion/minion_id\n - template: jinja\n - context:\n {% if grains[\'fqdn\'].startswith("localhost") %}\n fqdn: {{ grains[\'ipv4_mgmt\'] }} <===============
=======\n {% else %}\n fqdn: {{ grains[\'fqdn\'] }}\n {% endif %}\n\n{% elif grains["os"] == "Windows" %}\n[...]\n---'],
'success': True}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment