My code throws error when it reaches this line:
{% set encrypted_password = salt['cmd.run']('openssl enc -aes-128-cbc -a -salt -md md5 -in <(echo -n "' + ssm_plaintext_password +'") -pass pass:'+random_password) %}
Error:
[ERROR ] Command '[u'openssl', u'enc', u'-aes-128-cbc', u'-a', u'-salt', u'-md', u'md5', u'-in', u'<(echo', u'-n', u'g0vknM6a%,)', u'-pass', u'pass:zHwhIwKesJVXZO9taCHuEVGSPTW3J95g']' failed with return code: 1
[ERROR ] stdout: unknown option '-n'
But when I run the command openssl enc -aes-128-cbc -a -salt -md md5 -in <(echo -n "g0vknM6a%,") -pass pass:zHwhIwKesJVXZO9taCHuEVGSPTW3J95g it gives me the input.
I am executing this in Amazon Linux2 based instance having Python3 and salt-call 2019.2.0 (Fluorine) . Is this due to any binary version changes as this code worked perfectly with Amazon Linux1