dheule wrote on 02/27/2014 09:17 AM:
>> @@ -68,3 +46,94 @@ DONE
>>          echo "Unknown state: $state_should" >&2
>>          exit 1
>>   esac
>> +
>> +cat <<__CDIST_HEREDOC_END_HERE_MARKER
>
> Hey steven,
>
> please read the code correct...
>
> [ "$state_is" = "$state_should" ] && exit 0 <<< the whole awk is only executed if a change is needed

sidenote: Be careful with this idiom. If this is the last statement in a 
script and the test returns false the whole script/cdist/run will fail.

This has bitten me a few times. I started using the long version instead 
which does not have this problem.
if [ "foo" = "bla" ]; then
   # whatever
fi