diff --git a/REFERENCE.md b/REFERENCE.md index 76d672ff..d76a0586 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -1352,6 +1352,12 @@ Data type: `Optional[Boolean]` If true, run Puppet in no-op mode +##### `in_progress_timeout` + +Data type: `Integer[1]` + +How many seconds to wait for a puppet run, that is already in progress + ### `rbac_token` Get and save an rbac token for the root user, admin rbac user diff --git a/tasks/puppet_runonce.json b/tasks/puppet_runonce.json index 0be93712..087b60fe 100644 --- a/tasks/puppet_runonce.json +++ b/tasks/puppet_runonce.json @@ -8,6 +8,11 @@ "noop": { "type": "Optional[Boolean]", "description": "If true, run Puppet in no-op mode" + }, + "in_progress_timeout": { + "type": "Integer[1]", + "description": "How many seconds to wait for a puppet run, that is already in progress", + "default": 600 } }, "input_method": "environment", diff --git a/tasks/puppet_runonce.sh b/tasks/puppet_runonce.sh index fe08a946..1e72c86a 100755 --- a/tasks/puppet_runonce.sh +++ b/tasks/puppet_runonce.sh @@ -15,7 +15,7 @@ echo -n "Check for and wait up to 5 minutes for in-progress run to complete" lockfile=$(/opt/puppetlabs/bin/puppet config print agent_catalog_run_lockfile) n=0 -until [ $n -ge 300 ] +until [ $n -ge "$PT_in_progress_timeout" ] do [ ! -e "$lockfile" ] && break echo -n .