salt icon indicating copy to clipboard operation
salt copied to clipboard

Auto-order does not work when using template code snippets in the states.

Open kevintsai opened this issue 12 years ago • 2 comments

Description

Auto-order does not work when using template code snippets in the states.

Environment

Master: CentOS 6.5, salt-master 2014.1.4 Minion: CentOS 6.5, salt-minion 2014.1.4

SLS
{% set need_install = salt['cmd.script']('salt://chk_require_ver.sh', ...) %}
{% if need_install.retcode %}
..... Here will not be in the sequence of auto-order.
{% endif %}
Summary

It's unexpected the running sequence of the state.show_lowstate.

Before fix this issue, have any suggestion for running states depends on the specified result(stdout/retcode) of cmd.run(script) and in the expected running sequence? It will helps me a lot to moving deploy code to SaltStack from others.

kevintsai avatar Jun 15 '14 14:06 kevintsai

Thanks for the report, we'll look into the ordering.

To answer your question, I would recommend creating a custom module. That module could run the script, and parse its output, and then return whatever information you needed.

http://docs.saltstack.com/en/latest/ref/modules/

basepi avatar Jun 16 '14 17:06 basepi

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

stale[bot] avatar Dec 05 '17 00:12 stale[bot]