mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 22:33:25 +00:00
Different return codes for different errors.
This commit is contained in:
@@ -129,9 +129,9 @@ if __name__ == '__main__':
|
||||
(runner, results) = cli.run(options, args)
|
||||
for result in results['contacted'].values():
|
||||
if 'failed' in result or result.get('rc', 0) != 0:
|
||||
sys.exit(1)
|
||||
sys.exit(2)
|
||||
if results['dark']:
|
||||
sys.exit(1)
|
||||
sys.exit(2)
|
||||
except errors.AnsibleError, e:
|
||||
# Generic handler for ansible specific errors
|
||||
print "ERROR: %s" % str(e)
|
||||
|
||||
Reference in New Issue
Block a user