Skip to content

Commit 11c663a

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 1b99564 commit 11c663a

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
@@ -37,8 +37,8 @@
3737
let(:unknown_targets) { targets.reject { |target| target.protocol == 'pcp' } }
3838
let(:fact) { { 'osfamily' => 'none' } }
3939
let(:custom_facts_task) { Bolt::Task.new('custom_facts_task') }
40-
let(:version_task) { Bolt::Task.new('puppet_agent::version') }
41-
let(:install_task) { Bolt::Task.new('puppet_agent::install') }
40+
let(:version_task) { Bolt::Task.new('openvox_bootstrap::check') }
41+
let(:install_task) { Bolt::Task.new('openvox_bootstrap::install') }
4242
let(:service_task) { Bolt::Task.new('service') }
4343

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

5050
task1 = mock('version_task')
51-
task1.stubs(:task_hash).returns('name' => 'puppet_agent::version')
51+
task1.stubs(:task_hash).returns('name' => 'openvox_bootstrap::check')
5252
task1.stubs(:runnable_with?).returns(true)
53-
Puppet::Pal::ScriptCompiler.any_instance.stubs(:task_signature).with('puppet_agent::version').returns(task1)
53+
Puppet::Pal::ScriptCompiler.any_instance.stubs(:task_signature).with('openvox_bootstrap::check').returns(task1)
5454
task2 = mock('install_task')
55-
task2.stubs(:task_hash).returns('name' => 'puppet_agent::install')
55+
task2.stubs(:task_hash).returns('name' => 'openvox_bootstrap::install')
5656
task2.stubs(:runnable_with?).returns(true)
57-
Puppet::Pal::ScriptCompiler.any_instance.stubs(:task_signature).with('puppet_agent::install').returns(task2)
57+
Puppet::Pal::ScriptCompiler.any_instance.stubs(:task_signature).with('openvox_bootstrap::install').returns(task2)
5858
task3 = mock('service_task')
5959
task3.stubs(:task_hash).returns('name' => 'service')
6060
task3.stubs(:runnable_with?).returns(true)
@@ -142,7 +142,7 @@
142142
'plugin_hooks' => {
143143
'puppet_library' => {
144144
'plugin' => 'task',
145-
'task' => 'puppet_agent::install'
145+
'task' => 'openvox_bootstrap::install'
146146
}
147147
}
148148
}]

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
@@ -795,7 +795,7 @@ def plan_hierarchy_lookup(key, plan_vars: {})
795795
end
796796

797797
def lookup(key, targets, inventory, executor, plan_vars: {})
798-
# Install the puppet-agent package and collect facts. Facts are
798+
# Install the openvox-agent package and collect facts. Facts are
799799
# automatically added to the targets.
800800
in_plan_compiler(executor, inventory, nil) do |compiler|
801801
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
@@ -76,7 +76,7 @@
7676
let(:user) { conn_info('ssh')[:user] }
7777
let(:password) { conn_info('ssh')[:password] }
7878

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

310-
# Run tests for installing the puppet-agent package using apply_prep.
310+
# Run tests for installing the openvox-agent package using apply_prep.
311311
context 'installing puppet' do
312312
let(:config) do
313313
{
@@ -394,7 +394,7 @@
394394
'plugin_hooks' => {
395395
'puppet_library' => {
396396
'plugin' => 'task',
397-
'task' => 'puppet_agent::install',
397+
'task' => 'openvox_bootstrap::install',
398398
'parameters' => {
399399
'version' => '7.0.0'
400400
}
@@ -415,7 +415,7 @@
415415
report = result[0]['value']['report']
416416
expect(report['resource_statuses']).to include("Notify[Hello #{uri}]")
417417

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

420420
result = results['items']
421421
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
@@ -683,7 +683,7 @@ def fact_plan(name = 'facts_test')
683683
{
684684
'puppet_library' => {
685685
'plugin' => 'task',
686-
'task' => 'puppet_agent::install',
686+
'task' => 'openvox_bootstrap::install',
687687
'parameters' => {
688688
'version' => '6.19.0',
689689
'collection' => 'puppet6'

0 commit comments

Comments
 (0)