ansible-oracle icon indicating copy to clipboard operation
ansible-oracle copied to clipboard

bug: extra indents in yaml blocks produce unwanted newlines

Open bartowl opened this issue 11 months ago • 0 comments

It showed particulary in oradb_rman role, where due to additional indents in >- block unwanted newlines were produced by builtin.shell command line, which caused the task to fail. Due to the syntax of commandline produced this however did not produce exitcode != 0 and was not recognised as failed by ansible.

Here is how a command looked like:

cmd: "/u01/app/oracle/bin/rman_backup.sh\n -a parameter\n -s CDB1\n -r /u01/app/oracle/rman\n -l /u01/app/oracle/rman/log | tee -a /var/log/oracle/rman/log/rman_parameter.log"

This of course produced following output: stdout: "Missing parameter for ORACLE_SID\n \nUsage:\n rman_backup.sh -a -s <ORACLE_SID|DB_NAME> [-r <Directory>]\n [-l <Directory>] [-c <CATALOGCONNECT>] [-t <TARGETCONNECT>]\n [--service <Servicename in GI/Restart>]\n rman_backup.sh -h",

Similar problems, yet rather optical than functional have been corrected over entire roles/ code basis. Only where extra indenting was done inside {{ ... }} blocks, it has not been removed, as it did not introduce any unexpected newlines.

bartowl avatar Mar 08 '24 11:03 bartowl