saltstack-formulas / splunkforwarder-formula

Splunk Forwarder Salt Formula http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
9 stars 18 forks source link

Running state.highstate with test=True produces spurious Differs result on package version comparison #2

Closed KingJ closed 3 years ago

KingJ commented 8 years ago

When running a state.highstate test=True against a minion, the package version check returns Differs instead of Clean;

new=$(dpkg-deb --showformat='${Package} ${Version}\n' -W splunkforwarder-6.4.0-f2c836328108-linux-2.6-amd64.deb); old=$(dpkg-query --showformat='${Package} ${Version}\n' -W splunkforwarder); if test "$new" != "$old"; then echo; echo "changed=true comment='new($new) vs old($old)'"; else echo; echo "changed=false"; fi; - Function: cmd.run - Result: Differs

However, when running a state.highstate without test=True against a minion, the result comes back as clean (unless the package version actually differs);

Name: new=$(dpkg-deb --showformat='${Package} ${Version}\n' -W splunkforwarder-6.4.0-f2c836328108-linux-2.6-amd64.deb); old=$(dpkg-query --showformat='${Package} ${Version}\n' -W splunkforwarder); if test "$new" != "$old"; then echo; echo "changed=true comment='new($new) vs old($old)'"; else echo; echo "changed=false"; fi; - Function: cmd.run - Result: Clean

noelmcloughlin commented 3 years ago

8