salt icon indicating copy to clipboard operation
salt copied to clipboard

Out of order the execute sequence when use the 'names' parameters in states.

Open kevintsai opened this issue 12 years ago • 3 comments

Description

Out of order the execute sequence when use the 'names' parameters in states.

Environment

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

SLS
aaa:
  cmd.run:
    - names:
      - echo a1
      - echo a2

bbb:
  cmd.run:
    - name: echo b1
Summary

The result says the sequence is a1->b1->a2. It confused me. Is it running as a1->a2->b1 sequence actually? or it's asynchronous running when use 'names' parameters? Is it possible to know the actually running sequence?

Sorry for my poor English and many question about the issue.

kevintsai avatar Jun 07 '14 07:06 kevintsai

If you do a salt 'myminion' state.show_lowstate, it will actually compile the highstate run for that minion and you can see exactly what order it's going to run in.

It looks like we may have a bug in the way that - names is applied to the state run. When we added state_auto_order: True to the state compiler, we may have missed that particular edge case. Thanks for the report, we'll get this fixed.

basepi avatar Jun 09 '14 19:06 basepi

I can reproduce this issue with the states provided.

My working theory is that when we expand the - names argument into separate states, the additional states are appended to the bottom of the file as far as ordering goes.

We will investigate this.

basepi avatar Jun 18 '14 17:06 basepi

Hey team, I'm experiencing same problem. Is this planned to address?

shamil avatar Sep 10 '14 18:09 shamil