Skip to content

Conversation

@jpartlow
Copy link
Contributor

@jpartlow jpartlow commented Aug 8, 2025

This is for integration with openbolt for openvoxproject/openbolt@44.

Bolt was providing a stop_service parameter to the puppetlabs-puppet_agent module here:
https://github.com/OpenVoxProject/openbolt/blob/b9bff5a8dfe2f41218281bf8c5e6ad901bcae460/lib/bolt/plugin.rb#L133

This was for puppetlabs/bolt#1204, and while the current linux packages, at least, install with service stopped, it's probably still good practice to ensure it for the openbolt case. (This may have been more of an issue when some packages were still SysV?)

Since our install task is more general, it could be used for openvox-server/openvoxdb, but there's no particular use case for this, and I haven't bothered with acceptance tests for them.

This Pull Request (PR) fixes the following issues

@jpartlow jpartlow force-pushed the gh-35-add-stop-service-to-install branch 2 times, most recently from 01c0ab4 to c46dde2 Compare August 8, 2025 19:34
@jpartlow jpartlow force-pushed the gh-35-add-stop-service-to-install branch 4 times, most recently from f946b75 to 2ca3a60 Compare August 8, 2025 21:34
This is for integration with openbolt for openvoxproject/openbolt@44.

Bolt was providing a stop_service parameter to the
puppetlabs-puppet_agent module here:
https://github.com/OpenVoxProject/openbolt/blob/b9bff5a8dfe2f41218281bf8c5e6ad901bcae460/lib/bolt/plugin.rb#L133

This was for puppetlabs/bolt#1204, and while the current linux packages,
at least, install with service stopped, it's probably still good
practice to ensure it for the openbolt case. (This may have been more of
an issue when some packages were still SysV?)

Since our install task is more general, it could be used for
openvox-server/openvoxdb, but there's no particular use case for this,
and I haven't bothered with acceptance tests for them.
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.
@jpartlow jpartlow force-pushed the gh-35-add-stop-service-to-install branch from 2ca3a60 to 6c07d34 Compare August 8, 2025 21:44
@bastelfreak bastelfreak merged commit d517aca into voxpupuli:main Oct 25, 2025
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants