Skip to content

Commit 1e813cf

Browse files
committed
apply_prep to install openvox-agent
- replaces puppetlabs-puppet_agent with puppet-openvox_bootstrap for automatic installation of openvox-agent rather than puppet-agent packages. (Nb, this doesn’t yet support Windows) - temporarily set to a branch of openvox_bootstrap
1 parent 67b6ac6 commit 1e813cf

File tree

13 files changed

+38
-38
lines changed

13 files changed

+38
-38
lines changed

bolt-modules/boltlib/lib/puppet/functions/apply_prep.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
require 'bolt/logger'
44
require 'bolt/task'
55

6-
# Installs the `puppet-agent` package on targets if needed, then collects facts,
6+
# Installs the `openvox-agent` package on targets if needed, then collects facts,
77
# including any custom facts found in Bolt's module path. The package is
88
# installed using either the configured plugin or the `task` plugin with the
9-
# `puppet_agent::install` task.
9+
# `openvox_bootstrap::install` task.
1010
#
1111
# Agent installation will be skipped if the target includes the `puppet-agent`
12-
# feature, either as a property of its transport (PCP) or by explicitly setting
12+
# feature, either as a property of its transport or by explicitly setting
1313
# it as a feature in Bolt's inventory.
1414
#
1515
# > **Note:** Not available in apply block

bolt-modules/boltlib/lib/puppet/functions/get_resources.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# The results are returned as a list of hashes representing each resource.
77
#
88
# Requires the Puppet Agent be installed on the target, which can be accomplished with apply_prep
9-
# or by directly running the `puppet_agent::install` task. In order to be able to reference types without
9+
# or by directly running the `openvox_bootstrap::install` task. In order to be able to reference types without
1010
# string quoting (for example `get_resources($target, Package)` instead of `get_resources($target, 'Package')`),
1111
# run the command `bolt puppetfile generate-types` to generate type references in `$Boldir/.resource_types`.
1212
#

bolt-modules/boltlib/spec/functions/apply_prep_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
let(:unknown_targets) { targets.reject { |target| target.protocol == 'pcp' } }
3737
let(:fact) { { 'osfamily' => 'none' } }
3838
let(:custom_facts_task) { Bolt::Task.new('custom_facts_task') }
39-
let(:version_task) { Bolt::Task.new('puppet_agent::version') }
40-
let(:install_task) { Bolt::Task.new('puppet_agent::install') }
39+
let(:version_task) { Bolt::Task.new('openvox_bootstrap::check') }
40+
let(:install_task) { Bolt::Task.new('openvox_bootstrap::install') }
4141
let(:service_task) { Bolt::Task.new('service') }
4242

4343
before(:each) do
@@ -47,13 +47,13 @@
4747
targets.each { |t| inventory.set_feature(t, 'puppet-agent', false) }
4848

4949
task1 = mock('version_task')
50-
task1.stubs(:task_hash).returns('name' => 'puppet_agent::version')
50+
task1.stubs(:task_hash).returns('name' => 'openvox_bootstrap::check')
5151
task1.stubs(:runnable_with?).returns(true)
52-
Puppet::Pal::ScriptCompiler.any_instance.stubs(:task_signature).with('puppet_agent::version').returns(task1)
52+
Puppet::Pal::ScriptCompiler.any_instance.stubs(:task_signature).with('openvox_bootstrap::check').returns(task1)
5353
task2 = mock('install_task')
54-
task2.stubs(:task_hash).returns('name' => 'puppet_agent::install')
54+
task2.stubs(:task_hash).returns('name' => 'openvox_bootstrap::install')
5555
task2.stubs(:runnable_with?).returns(true)
56-
Puppet::Pal::ScriptCompiler.any_instance.stubs(:task_signature).with('puppet_agent::install').returns(task2)
56+
Puppet::Pal::ScriptCompiler.any_instance.stubs(:task_signature).with('openvox_bootstrap::install').returns(task2)
5757
task3 = mock('service_task')
5858
task3.stubs(:task_hash).returns('name' => 'service')
5959
task3.stubs(:runnable_with?).returns(true)
@@ -141,7 +141,7 @@
141141
'plugin_hooks' => {
142142
'puppet_library' => {
143143
'plugin' => 'task',
144-
'task' => 'puppet_agent::install'
144+
'task' => 'openvox_bootstrap::install'
145145
}
146146
}
147147
}]

documentation/applying_manifest_blocks.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ Manifest blocks require facts to compile. When Bolt applies Puppet manifests, it
3333
automatically installs the packages necessary to run the apply command and
3434
gathers facts using [facter](https://puppet.com/docs/facter/latest/), making the
3535
facts available to the manifest block. Bolt also identifies targets that do not
36-
have Puppet agents and runs the [`puppet_agent::install`
37-
task](https://forge.puppet.com/puppetlabs/puppet_agent) to install the agent.
36+
have Puppet agents and runs the [`openvox_bootstrap::install`
37+
task](https://forge.puppet.com/puppet/openvox_bootstrap) to install the agent.
3838

39-
> **Note:** Bolt installs the Puppet agent package to enable the use of Puppet
39+
> **Note:** Bolt installs the OpenVox agent package to enable the use of Puppet
4040
code. It does not require setting up a server-agent architecture between the
4141
remote systems and the local system running Bolt.
4242

@@ -240,7 +240,7 @@ access the `logs` key in the report hash:
240240
plan example (
241241
TargetSpec $targets
242242
) {
243-
# Install the puppet-agent package and gather facts
243+
# Install the openvox-agent package and gather facts
244244
$targets.apply_prep
245245
246246
# Apply Puppet code
@@ -400,7 +400,7 @@ Create a manifest that sets up a web server with nginx, and run it as a plan.
400400
String $site_content = 'hello!',
401401
) {
402402
403-
# Install the puppet-agent package if Puppet is not detected.
403+
# Install the openvox-agent package if Puppet is not detected.
404404
# Copy over custom facts from the Bolt modulepath.
405405
# Run the `facter` command line tool to gather target information.
406406
$targets.apply_prep
@@ -479,7 +479,7 @@ Create a manifest that sets up a web server with IIS and run it as a plan.
479479
String $site_content = 'hello!',
480480
) {
481481
482-
# Install the puppet-agent package if Puppet is not detected.
482+
# Install the openvox-agent package if Puppet is not detected.
483483
# Copy over custom facts from the Bolt modulepath.
484484
# Run the `facter` command line tool to gather target information.
485485
$targets.apply_prep

documentation/bolt_inventory_reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ level apply to all groups and targets in the inventory file.
5555
- **Type:** Array
5656

5757
> 🔩 **Tip:** You can set the `puppet-agent` feature to indicate that Bolt
58-
> should skip installing the Puppet agent on all targets when using
58+
> should skip installing the OpenVox agent on all targets when using
5959
> `bolt apply` or the `apply_prep` plan function.
6060

6161
```yaml
@@ -155,7 +155,7 @@ all groups and targets under the group.
155155
- **Type:** Array
156156

157157
> 🔩 **Tip:** You can set the `puppet-agent` feature on the group to indicate
158-
> that Bolt should skip installing the Puppet agent on all targets under the
158+
> that Bolt should skip installing the OpenVox agent on all targets under the
159159
> group when using `bolt apply` or the `apply_prep` plan function.
160160

161161
```yaml
@@ -316,7 +316,7 @@ A list of available features for the target.
316316
- **Type:** Array
317317

318318
> 🔩 **Tip:** You can set the `puppet-agent` feature on the target to indicate
319-
> that Bolt should skip installing the Puppet agent on the target when using
319+
> that Bolt should skip installing the OpenVox agent on the target when using
320320
> `bolt apply` or the `apply_prep` plan function.
321321

322322
```yaml

lib/bolt/pal.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ def plan_hierarchy_lookup(key, plan_vars: {})
792792
end
793793

794794
def lookup(key, targets, inventory, executor, plan_vars: {})
795-
# Install the puppet-agent package and collect facts. Facts are
795+
# Install the openvox-agent package and collect facts. Facts are
796796
# automatically added to the targets.
797797
in_plan_compiler(executor, inventory, nil) do |compiler|
798798
compiler.call_function('apply_prep', targets)

spec/bolt_spec/run_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
end
106106
end
107107

108-
context 'with a target that has a puppet-agent installed' do
108+
context 'with a target that has a openvox-agent installed' do
109109
def root_config
110110
{ 'ssh' => {
111111
'run-as' => 'root',
@@ -115,16 +115,16 @@ def root_config
115115
end
116116

117117
before(:all) do
118-
result = run_task('puppet_agent::version', 'ssh', {}, inventory: conn_inventory, config: root_config)
118+
result = run_task('openvox_bootstrap::check', 'ssh', {}, inventory: conn_inventory, config: root_config)
119119
expect(result.first['status']).to eq('success')
120120
unless result.first['value']['version']
121-
result = run_task('puppet_agent::install', 'ssh', {}, inventory: conn_inventory, config: root_config)
121+
result = run_task('openvox_bootstrap::install', 'ssh', {}, inventory: conn_inventory, config: root_config)
122122
end
123123
expect(result.first['status']).to eq('success')
124124
end
125125

126126
after(:all) do
127-
uninstall = '/opt/puppetlabs/bin/puppet resource package puppet-agent ensure=absent'
127+
uninstall = '/opt/puppetlabs/bin/puppet resource package openvox-agent ensure=absent'
128128
run_command(uninstall, 'ssh', inventory: conn_inventory, config: root_config)
129129
end
130130

spec/integration/apply_error_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
let(:tflags) { %w[--no-host-key-check] }
2020

2121
it 'prints a helpful error if Puppet is not present' do
22-
uninstall = '/opt/puppetlabs/bin/puppet resource package puppet-agent ensure=absent'
22+
uninstall = '/opt/puppetlabs/bin/puppet resource package openvox-agent ensure=absent'
2323
run_cli_json(%W[command run #{uninstall} --run-as root --sudo-password #{password}] + config_flags)
2424

2525
result = run_cli_json(%w[plan run basic::class] + config_flags)

spec/integration/apply_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
let(:user) { conn_info('ssh')[:user] }
7676
let(:password) { conn_info('ssh')[:password] }
7777

78-
# Run tests that require the puppet-agent package to be installed on the target.
78+
# Run tests that require the openvox-agent package to be installed on the target.
7979
# Each test is run against all agent targets unless otherwise noted.
8080
context 'with puppet installed' do
8181
# Set up a project directory for the tests. Include an inventory file so Bolt
@@ -304,7 +304,7 @@
304304
end
305305
end
306306

307-
# Run tests for installing the puppet-agent package using apply_prep.
307+
# Run tests for installing the openvox-agent package using apply_prep.
308308
context 'installing puppet' do
309309
let(:config) do
310310
{
@@ -391,7 +391,7 @@
391391
'plugin_hooks' => {
392392
'puppet_library' => {
393393
'plugin' => 'task',
394-
'task' => 'puppet_agent::install',
394+
'task' => 'openvox_bootstrap::install',
395395
'parameters' => {
396396
'version' => '7.0.0'
397397
}
@@ -412,7 +412,7 @@
412412
report = result[0]['value']['report']
413413
expect(report['resource_statuses']).to include("Notify[Hello #{uri}]")
414414

415-
results = run_cli_json(%W[task run puppet_agent::version -t #{uri}], project: project)
415+
results = run_cli_json(%W[task run openvox_bootstrap::check -t #{uri}], project: project)
416416

417417
result = results['items']
418418
expect(result.count).to eq(1)

spec/integration/inventory_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ def fact_plan(name = 'facts_test')
681681
{
682682
'puppet_library' => {
683683
'plugin' => 'task',
684-
'task' => 'puppet_agent::install',
684+
'task' => 'openvox_bootstrap::install',
685685
'parameters' => {
686686
'version' => '6.19.0',
687687
'collection' => 'puppet6'

0 commit comments

Comments
 (0)