Skip to content

Commit 85ef95f

Browse files
authored
Merge pull request #402 from vchepkov/runonce_environment
add environment parameter to puppet_runonce task
2 parents 4cd472f + be2870b commit 85ef95f

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

REFERENCE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,6 +1340,12 @@ Run the Puppet agent one time
13401340

13411341
#### Parameters
13421342

1343+
##### `environment`
1344+
1345+
Data type: `Optional[String]`
1346+
1347+
If set, run Puppet in specified code environment
1348+
13431349
##### `noop`
13441350

13451351
Data type: `Optional[Boolean]`

tasks/puppet_runonce.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"description": "Run the Puppet agent one time",
33
"parameters": {
4+
"environment": {
5+
"type": "Optional[String]",
6+
"description": "If set, run Puppet in specified code environment"
7+
},
48
"noop": {
59
"type": "Optional[Boolean]",
610
"description": "If true, run Puppet in no-op mode"

tasks/puppet_runonce.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
# Parse noop parameter
77
[ "$PT_noop" = "true" ] && NOOP_FLAG="--noop" || unset NOOP_FLAG
88

9+
# Parse environment parameter
10+
[ -n "$PT_environment" ] && ENV_FLAG="--environment $PT_environment" || unset ENV_FLAG
11+
912
# Wait for up to five minutes for an in-progress Puppet agent run to complete
1013
# TODO: right now the check is just for lock file existence. Improve the check
1114
# to account for situations where the lockfile is stale.
@@ -35,6 +38,7 @@ echo
3538
--no-use_cached_catalog \
3639
--detailed-exitcodes \
3740
--color false \
41+
$ENV_FLAG \
3842
$NOOP_FLAG
3943

4044
# Only exit non-zero if an error occurred. Changes (detailed exit code 2) are

0 commit comments

Comments
 (0)