Skip to content

Commit 63c3546

Browse files
authored
Merge pull request #190 from puppetlabs/cleaner-runonce-output
Clean up output of puppet_runonce task
2 parents 2381812 + f8368f0 commit 63c3546

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tasks/puppet_runonce.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Wait for up to five minutes for an in-progress Puppet agent run to complete
66
# TODO: right now the check is just for lock file existence. Improve the check
77
# to account for situations where the lockfile is stale.
8-
echo -n "Check for and wait up to 5 minutes for in-progress run to complete: "
8+
echo -n "Check for and wait up to 5 minutes for in-progress run to complete"
99
lockfile=$(/opt/puppetlabs/bin/puppet config print agent_catalog_run_lockfile)
1010
n=0
1111
until [ $n -ge 300 ]
@@ -17,6 +17,11 @@ do
1717
done
1818
echo
1919

20+
# Notes:
21+
# - Do not run with color, as the color codes can make interpreting output when
22+
# passed through Bolt difficult.
23+
# - Without --detailed-exitcodes, the `puppet agent` command will return 0 even
24+
# if there are a resource failures. So, use --detailed-exitcodes.
2025
/opt/puppetlabs/bin/puppet agent \
2126
--onetime \
2227
--verbose \
@@ -25,11 +30,11 @@ echo
2530
--no-splay \
2631
--no-use_cached_catalog \
2732
--detailed-exitcodes \
33+
--color false \
2834
$NOOP_FLAG
2935

30-
# Without --detailed-exitcodes, the `puppet agent` command will return 0 even
31-
# if there are resource failures. Use --detailed-exitcodes but only exit
32-
# non-zero if an error occurred. Changes (code 2) are not errors.
36+
# Only exit non-zero if an error occurred. Changes (detailed exit code 2) are
37+
# not errors.
3338
exitcode=$?
3439
if [ $exitcode -eq 0 -o $exitcode -eq 2 ]; then
3540
exit 0

0 commit comments

Comments
 (0)