File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,36 @@ service. This happens in lines **9** → **11**:
226
226
service : megafrobber
227
227
228
228
229
+ We can also add optional parameters ``tries `` and ``check_scripts ``. ``check_scripts ``
230
+ is an array of scripts that will be run after the command. If they all return success
231
+ (a zero return value) the whole command is considered successful. However if any
232
+ return a non zero value the step is considered failed. The ``tries `` parameter tells
233
+ the worker to try the step X number of times before giving up.
234
+
235
+ The following example will attempt the restart ``megafrobber `` and run the check_script
236
+ ``/usr/bin/diditwork ``. If the either the restart or the check script return a failure
237
+ it will try again until it's limit of 5 tries has been hit (at which point it returns
238
+ failure back to the bus).
239
+
240
+ .. code-block :: yaml
241
+ :linenos :
242
+ :emphasize-lines : 12,13
243
+
244
+ ---
245
+ group : inception
246
+ name : Setup megafrobber
247
+ execution :
248
+ - description : restart the megafrobber service
249
+ hosts :
250
+ - foo.bar.example.com
251
+ steps :
252
+ - funcworker.service :
253
+ subcommand : restart
254
+ service : megafrobber
255
+ tries : 5
256
+ check_scripts : ["/usr/bin/diditwork"]
257
+
258
+
229
259
More Modules
230
260
~~~~~~~~~~~~
231
261
You can’t perform that action at this time.
0 commit comments