When Configuration Templates fail to apply, the node status is updated to display Configuration Template Run Status: Failure or Partial Failure. Hovering over this status displays details as to which individual templates have succeeded and failed.
Hints with script error codes:
The error below is caused when script has syntax errors
Script executed with exit code 1
The error below is caused when script is not saved in Unix format.
Script executed with exit code 2
This error below is caused when script exits with ‘command not found’
Script executed with exit code 127
When manually applying templates, the Pre-Flight step checks that the configuration can be successfully pushed to each selected node, but does not check that the configuration will work – e.g. an incorrect AAA password will pass pre-flight checking.
When using automatic Enrollment Bundle templates, order is important – configuration set by later templates will replace (not append) configuration set earlier in the run. You may re-order templates using the arrow buttons.
When multiple templates are set to run, the run stops as soon as any one template fails.
In the context of Script Templates, failure means the script has returned a non-zero exit status.
To determine what part of the script is failing, insert the following lines at the top of your script:
#!/bin/bash # Fail entire script as soon as any single command fails set -e # Print commands as they run set -x # Log output to temporary file exec > >(tee -i /tmp/debug.log) exec 2>&1
Apply the script template to a single test node, then check the output in /tmp/debug.log on the node.
Note: When testing a script that will be applied automatically via Enrollment Bundle, test the process end-to-end as a final check. Due to subtle differences in system state, scripts that succeed when applied manually may fail during enrollment.