IBM / ansible-for-i

the tool is to provide several customized modules for Ansible to manage IBM i systems.
GNU General Public License v3.0
54 stars 52 forks source link

QUESTION : RC (Return code) table #202

Closed Pierroto69 closed 1 month ago

Pierroto69 commented 2 months ago

Hello support team, For business purpose we need RC (return code) numbers reference table for different errors when playbook are executed to ensure : o quick investigations and decision which corrective actions should be taken for elimination of unsuccessful executions.

o To have a generation of standardized, structured results from execution of Playbooks. This result contains status information about success of execution even on detail of particular actions (if needed) with information what is the reason for potential unsuccessful execution.

• For example we see some RC code in module display_fix and we would like to have all RC of all modules/roles do you have a document or somewhere to search ? Many thanks

See some TESTS

error with product name wrong format

                             "rc": 260,
                             "msg": "Value of product exceeds 7 characters",
                             "product": "579000000"

error with right format but product not exist

                              "rc": 264,
                              "stderr": "",
                              "msg": "No PTF information returned, check if the inputs are correct or if the PTF is loaded status",
                              "product": "5770NN3",
                              "ptf": "SI85144",
                              "release": "V7R3M0",
robgjertsen1 commented 2 months ago

I can see this definitely being useful. No information is provided today on specific return codes with modules or roles. Some would come from the module/role code itself that wouldn't be a big deal to document (first example you provide), but then others would be from IBM i commands on target nodes (or APIs to commands such as with ibmi_display_fix using IBM i OS API with the monitoring agent on target) and collection documentation would have to point to those items for their specific return codes. I don't think it is a good idea to list those latter return codes collectively in the ansible collection documentation because they can change and then we have incorrect information and it would be a nightmare to keep track of all of that, and that also applies to built in ansible modules used and ansible internal return codes (e.g., error if can't ssh to target, etc.), and looking closer at this it is quite a challenge to comprehensively document all the return codes in one place (and keep current). There is definitely room for improvement here though where we could document obvious rc's from the collection code and point to invoked IBM i commands for their rc's or what not.

Pierroto69 commented 1 month ago

Hi Rob , many thanks we will test some RC code errors