ansible
Ansible Exit Codes
Exit codes returned by Ansible commands such as ansible-playbook and ansible-galaxy. Code 0 indicates success; all other values indicate different categories of failure.
9 codes
references docs.ansible.com/ansible/latest/reference_appendices/general_precedence.htmldocs.ansible.com/ansible/latest/collections/ansible/builtin/index.html
· All codes 9 codes
- 0 Success The playbook or command completed successfully. All tasks ran without error.
- 1 General error An error occurred that prevented the playbook from running, such as an unhandled exception, a missing module, or an internal Ansible failure. Check stderr for details.
- 2 One or more hosts failed The playbook ran to completion but at least one task returned a failure status on at least one host. The specific failing tasks and hosts are listed in the play recap.
- 3 One or more hosts unreachable Ansible could not connect to one or more target hosts. Common causes include incorrect inventory, SSH key issues, firewall rules, or the target host being offline.
- 4 Parser error Ansible encountered a syntax or parse error in a playbook, task file, or inventory file. Run ansible-playbook --syntax-check to identify the location of the error.
- 5 Bad or incomplete options The command was invoked with invalid, conflicting, or missing options. Check the command-line arguments and consult ansible-playbook --help for valid usage.
- 6 User interrupted execution The user interrupted the playbook run, typically by pressing Ctrl-C. Tasks may have been partially applied; check host state before re-running.
- 99 Configuration error An error was found in ansible.cfg or in the command-line configuration. Verify that all configuration keys are valid and that required values are set correctly.
- 250 Unexpected error An unexpected internal error occurred, likely a bug in Ansible. File a bug report including the full traceback from stderr and the Ansible version (ansible --version).