Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #129 from MartyEwings/SUP-2847
(SUP-2847) Structured Returns for Herd resolver
- Loading branch information
Showing
4 changed files
with
13 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
#!/bin/bash | ||
declare PT__installdir | ||
source "$PT__installdir/bash_task_helper/files/task_helper.sh" | ||
|
||
# Puppet Task Name: bash_herd_resolver | ||
# This task is to be run on operating systems using a bash shell | ||
# It will randomise the restart of the puppet agent based on the current value of runinterval | ||
|
||
sleep $(( ( RANDOM % $(/opt/puppetlabs/bin/puppet agent --configprint runinterval) ) + 1 ))s | ||
/opt/puppetlabs/bin/puppet resource service puppet ensure=stopped | ||
/opt/puppetlabs/bin/puppet resource service puppet ensure=running | ||
sleep $(( ( RANDOM % $(/opt/puppetlabs/bin/puppet agent --configprint runinterval) ) + 1 ))s || fail "unable to set random sleep interval " | ||
/opt/puppetlabs/bin/puppet resource service puppet ensure=stopped || fail "unable stop puppet service " | ||
/opt/puppetlabs/bin/puppet resource service puppet ensure=running || fail "unable start puppet service " | ||
|
||
success '{ "status": "success - Agent restarted at random interval" }' |