Skip to content

Commit 561e350

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, 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 c738624 commit 561e350

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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)