You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An example is if a user is failed to be created the state always returns success.
the module returns an error but doesn't return failture error code to state:
(db)25db2:/home/dane# salt-call postgres.user_create 'dane'
[INFO ] Executing command 'psql --no-align --no-readline --username postgres --port 5432 --dbname postgres -c \'SELECT setting FROM pg_catalog.pg_settings WHERE name = \'"\'"\'server_version\'"\'"\'\' -t' as user 'postgres' in directory '/home/postgres'
[INFO ] Executing command 'psql --no-align --no-readline --username postgres --port 5432 --dbname postgres -v datestyle=ISO,MDY -c \'COPY (SELECT rolname as "name", rolsuper as "superuser", rolinherit as "inherits privileges", rolcreaterole as "can create roles", rolcreatedb as "can create databases", rolcatupdate as "can update system catalogs", rolcanlogin as "can login", rolreplication as "replication", rolconnlimit as "connections", rolvaliduntil::timestamp(0) as "expiry time", rolconfig as "defaults variables" FROM pg_roles) TO STDOUT WITH CSV HEADER\'' as user 'postgres' in directory '/home/postgres'
[INFO ] Executing command 'psql --no-align --no-readline --username postgres --port 5432 --dbname postgres -c \'CREATE USER "dane"\'' as user 'postgres' in directory '/home/postgres'
local:
ERROR: cannot execute CREATE ROLE in a read-only transaction
The text was updated successfully, but these errors were encountered:
So you're just talking about the return code? That is by design -- the retcode is designed to just tell whether salt executed successfully, it doesn't have any bearing on whether the states/modules were successful or not.
There are a few open issues for a flag to change this behavior. Also, salt-call has a --retcode-passthrough that might serve your purposes.
An example is if a user is failed to be created the state always returns success.
the module returns an error but doesn't return failture error code to state:
The text was updated successfully, but these errors were encountered: