Skip to content

Commit 6c07d34

Browse files
committed
(gh-35) Make install.json optional parameters consistent
Strictly speaking, given that the parameters have defaults, it should not be necessary to type them 'Optional' in install.json. But the install task is used as the puppet_library plugin for installing openvox via apply_prep, and something about how Bolt constructs the task there causes a failure for non optional parameters, even if they have defaults: jpartlow@archimedes:~/work/src/kvm_automation_tooling$ cat plans/test.pp plan kvm_automation_tooling::test() { apply_prep('b-alma9-ov8-agent-1') } jpartlow@archimedes:~/work/src/kvm_automation_tooling$ be bolt plan run kvm_automation_tooling::test --inventory terraform/instances/inventory.b-alma9-ov8.yaml Starting: plan kvm_automation_tooling::test Starting: install puppet and gather facts on b-alma9-ov8-agent-1 Finished: plan kvm_automation_tooling::test in 0.27 sec Failed on b-alma9-ov8-agent-1: Error executing plugin task from puppet_library: Task openvox_bootstrap::install: expects a value for parameter 'package' Failed on 1 target: b-alma9-ov8-agent-1 Ran on 1 target Some parameters will be wired into openbolt's DEFAULT_PLUGIN_HOOKS (https://github.com/OpenVoxProject/openbolt/blob/b9bff5a8dfe2f41218281bf8c5e6ad901bcae460/lib/bolt/plugin.rb#L133) and stop_service is already one of them. (See OpenVoxProject/openbolt#49) But to keep everything consistent, I'm setting all the parameters optional with the defaults explicit so that it's at least clear to a caller running 'bolt task show openvox_bootstrap::install' what must be provided and what the defaults are.
1 parent da68285 commit 6c07d34

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

REFERENCE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,15 @@ Installs an openvox package. By default, this will be the latest openvox-agent f
123123

124124
##### `package`
125125

126-
Data type: `String[1]`
126+
Data type: `Optional[String]`
127127

128128
The name of the package to install.
129129

130130
##### `version`
131131

132132
Data type: `Optional[String]`
133133

134-
The version of the openvox-agent package to install. Defaults to latest.
134+
The version of the openvox-agent package to install.
135135

136136
##### `collection`
137137

tasks/install.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
"parameters": {
44
"package": {
55
"description": "The name of the package to install.",
6-
"type": "String[1]",
6+
"type": "Optional[String]",
77
"default": "openvox-agent"
88
},
99
"version": {
10-
"description": "The version of the openvox-agent package to install. Defaults to latest.",
11-
"type": "Optional[String]"
10+
"description": "The version of the openvox-agent package to install.",
11+
"type": "Optional[String]",
12+
"default": "latest"
1213
},
1314
"collection": {
1415
"description": "The openvox collection to install from.",

0 commit comments

Comments
 (0)