vagrant-pe_build 0.14.2 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +16 -0
- data/README.markdown +4 -2
- data/lib/pe_build/cap/detect_installer/ubuntu.rb +1 -1
- data/lib/pe_build/cap/run_install/posix.rb +35 -2
- data/lib/pe_build/cap/run_install/windows.rb +3 -1
- data/lib/pe_build/config/pe_bootstrap.rb +6 -2
- data/lib/pe_build/provisioner/pe_bootstrap/answers_file.rb +3 -1
- data/lib/pe_build/provisioner/pe_bootstrap.rb +45 -15
- data/lib/pe_build/release/2016_1.rb +4 -3
- data/lib/pe_build/release/2016_2.rb +30 -0
- data/lib/pe_build/release.rb +2 -1
- data/lib/pe_build/version.rb +1 -1
- data/templates/answers/master-2016.2.x.conf.erb +14 -0
- data/templates/locales/en.yml +13 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74737936d5c81404d14bdffed7e5e2e09bfd8509
|
4
|
+
data.tar.gz: eee7a5b8e6c304c4c30f29d38b69d300ae6bb9e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1289a74c813df50dc247c925c7880e5a83d142c3eb54c0640393dc18e8d4cd1a07eae7be218183d5e3d745114810d4a42cc9b609221e828f31539c1ef4cbea9f
|
7
|
+
data.tar.gz: bb9a03e99eb021c2079d29f421c7e8bbff9c12768b74910189bdebd138ed1c0d1cec9c1b93af66690c8b7fa93a222d704d69895b95bfd903388dfa142b31e90f
|
data/CHANGELOG
CHANGED
@@ -1,6 +1,22 @@
|
|
1
1
|
vagrant-pe_build
|
2
2
|
================
|
3
3
|
|
4
|
+
0.15.0
|
5
|
+
------
|
6
|
+
|
7
|
+
2016-05-11
|
8
|
+
|
9
|
+
This is a backwards incompatible feature release.
|
10
|
+
|
11
|
+
* (GH-95) *Breaking change* Using the pe_bootstrap provisioner to install
|
12
|
+
is deprecated for 2015.2.0 and newer and raises an error starting with
|
13
|
+
2016.2.0. Agent installs should be transitioned to the pe_agent
|
14
|
+
provisioner.
|
15
|
+
|
16
|
+
* (GH-116) Starting with PE 2016.2.0, the new PEM installer is used to
|
17
|
+
install Puppet Masters. Answer files for this installer should be
|
18
|
+
written in HOCON format instead of bash format.
|
19
|
+
|
4
20
|
0.14.2
|
5
21
|
------
|
6
22
|
|
data/README.markdown
CHANGED
@@ -55,8 +55,10 @@ can be overridden at this point.
|
|
55
55
|
|
56
56
|
* `role`
|
57
57
|
* Description: The role of the Puppet Enterprise install.
|
58
|
-
* Options: `:agent`, `:master`
|
59
|
-
|
58
|
+
* Options: `:agent`, `:master`. `:agent` has been deprecated starting with
|
59
|
+
PE 2015.2.0 and is no longer valid for PE 2016.2.0 having been replaced
|
60
|
+
by a dedicated `pe_agent` provisioner described below.
|
61
|
+
* Default: `:agent` for PE < 2016.2.0 and `:master` for PE >= 2016.2.0.
|
60
62
|
* `verbose`
|
61
63
|
* Description: Whether or not to show the verbose output of the Puppet
|
62
64
|
Enterprise install.
|
@@ -5,13 +5,46 @@ class PEBuild::Cap::RunInstall::POSIX
|
|
5
5
|
|
6
6
|
# Run the PE installer on POSIX systems
|
7
7
|
#
|
8
|
+
# @param machine [Vagrant::Machine] The Vagrant machine on which to run the
|
9
|
+
# installation.
|
8
10
|
# @param installer_dir [String] A path to the directory where PE installers
|
9
11
|
# are kept.
|
10
12
|
# @param answers [String] A path to a file containing installation answers.
|
13
|
+
# @option options [Boolean] A flag which controls whether the PEM installer
|
14
|
+
# introduced in 2016.2 should be used.
|
11
15
|
#
|
12
16
|
# @return [void]
|
13
|
-
def self.run_install(machine, installer_path, answers)
|
14
|
-
|
17
|
+
def self.run_install(machine, installer_path, answers, **options)
|
18
|
+
if options.fetch(:use_pem, false)
|
19
|
+
# NOTE: Ensure symlinks exist since minitar doesn't create them. This
|
20
|
+
# call will be reverted once the PEM changes are finalized.
|
21
|
+
on_machine(machine, <<-EOS)
|
22
|
+
pushd #{File.dirname(installer_path)} > /dev/null
|
23
|
+
if [ -d pe-manager ]
|
24
|
+
then
|
25
|
+
pushd pe-manager > /dev/null
|
26
|
+
ln -sf ../VERSION ../modules .
|
27
|
+
pushd packages > /dev/null
|
28
|
+
ln -sf ../../packages/* .
|
29
|
+
fi
|
30
|
+
EOS
|
31
|
+
on_machine(machine, "#{installer_path} -c #{answers}")
|
32
|
+
else
|
33
|
+
# NOTE: Ensure symlinks exist since minitar doesn't create them. This
|
34
|
+
# call will be reverted once the PEM changes are finalized.
|
35
|
+
on_machine(machine, <<-EOS)
|
36
|
+
pushd #{File.dirname(installer_path)} > /dev/null
|
37
|
+
if [ -d legacy ]
|
38
|
+
then
|
39
|
+
pushd legacy > /dev/null
|
40
|
+
for f in $(find . -type f -empty)
|
41
|
+
do
|
42
|
+
ln -sf ../$f $f
|
43
|
+
done
|
44
|
+
fi
|
45
|
+
EOS
|
46
|
+
on_machine(machine, "#{installer_path} -a #{answers}")
|
47
|
+
end
|
15
48
|
|
16
49
|
if machine.communicate.test('which at')
|
17
50
|
machine.ui.info I18n.t('pebuild.cap.run_install.scheduling_run')
|
@@ -5,12 +5,14 @@ class PEBuild::Cap::RunInstall::Windows
|
|
5
5
|
|
6
6
|
# Run the PE installer on Windows systems
|
7
7
|
#
|
8
|
+
# @param machine [Vagrant::Machine] The Vagrant machine on which to run the
|
9
|
+
# installation.
|
8
10
|
# @param installer_dir [String] A path to the PE installer.
|
9
11
|
# @param answers [Hash[String => String}] A hash of options that will be
|
10
12
|
# passed to msiexec as `key=value` pairs.
|
11
13
|
#
|
12
14
|
# @return [void]
|
13
|
-
def self.run_install(machine, installer_path, answers)
|
15
|
+
def self.run_install(machine, installer_path, answers, **options)
|
14
16
|
install_options = answers.map{|e| e.join('=')}.join(' ')
|
15
17
|
# Lots of PowerShell commands can handle UNIX-style paths. msiexec can't.
|
16
18
|
installer_path = installer_path.gsub('/', '\\')
|
@@ -74,7 +74,7 @@ class PEBuild::Config::PEBootstrap < PEBuild::Config::Global
|
|
74
74
|
# global configuration; it's assumed that the late configuration merging in
|
75
75
|
# the provisioner will handle that.
|
76
76
|
def finalize!
|
77
|
-
set_default :@role,
|
77
|
+
set_default :@role, nil
|
78
78
|
set_default :@verbose, true
|
79
79
|
set_default :@master, 'master'
|
80
80
|
set_default :@answer_file, nil
|
@@ -89,7 +89,7 @@ class PEBuild::Config::PEBootstrap < PEBuild::Config::Global
|
|
89
89
|
#
|
90
90
|
# We also need to run this after a default was set, otherwise we'll try to
|
91
91
|
# normalize UNSET_VALUE
|
92
|
-
@role = @role.intern
|
92
|
+
@role = @role.intern unless @role.nil?
|
93
93
|
end
|
94
94
|
|
95
95
|
# @param machine [Vagrant::Machine]
|
@@ -113,6 +113,10 @@ class PEBuild::Config::PEBootstrap < PEBuild::Config::Global
|
|
113
113
|
private
|
114
114
|
|
115
115
|
def validate_role(errors, machine)
|
116
|
+
# A nil default is handled later on by the provisioner implementation after
|
117
|
+
# version information from the global config is merged in.
|
118
|
+
return if @role.nil?
|
119
|
+
|
116
120
|
unless VALID_ROLES.any? {|sym| @role == sym.intern}
|
117
121
|
errors << I18n.t(
|
118
122
|
'pebuild.config.pe_bootstrap.errors.unknown_role',
|
@@ -10,6 +10,8 @@ require 'erb'
|
|
10
10
|
# @api private
|
11
11
|
class PEBuild::Provisioner::PEBootstrap::AnswersFile
|
12
12
|
|
13
|
+
attr_reader :template
|
14
|
+
|
13
15
|
# @param machine [Vagrant::Machine]
|
14
16
|
# @param config [Object < Vagrant.plugin('2', :config)]
|
15
17
|
# @param work_dir [String]
|
@@ -48,7 +50,7 @@ class PEBuild::Provisioner::PEBootstrap::AnswersFile
|
|
48
50
|
@template = @config.answer_file
|
49
51
|
mode = 'explicit'
|
50
52
|
else
|
51
|
-
release_info = PEBuild::Release[@config.version]
|
53
|
+
release_info = PEBuild::Release[@config.version.split('-').first]
|
52
54
|
|
53
55
|
@template = release_info.answer_file(@config.role)
|
54
56
|
mode = 'default'
|
@@ -3,6 +3,7 @@ require 'vagrant'
|
|
3
3
|
require 'pe_build/archive'
|
4
4
|
require 'pe_build/util/config'
|
5
5
|
require 'pe_build/util/versioned_path'
|
6
|
+
require 'pe_build/util/version_string'
|
6
7
|
|
7
8
|
require 'log4r'
|
8
9
|
require 'fileutils'
|
@@ -20,6 +21,10 @@ module PEBuild
|
|
20
21
|
error_key(:unset_version, 'pebuild.provisioner.pe_bootstrap.errors')
|
21
22
|
end
|
22
23
|
|
24
|
+
class AgentRoleRemovedError < Vagrant::Errors::VagrantError
|
25
|
+
error_key(:agent_role_removed, 'pebuild.provisioner.pe_bootstrap.errors')
|
26
|
+
end
|
27
|
+
|
23
28
|
# @!attribute [r] work_dir
|
24
29
|
# @return [String] The path to the machine pe_build working directory
|
25
30
|
|
@@ -53,6 +58,7 @@ module PEBuild
|
|
53
58
|
FileUtils.mkdir_p work_dir
|
54
59
|
end
|
55
60
|
end
|
61
|
+
|
56
62
|
def provision
|
57
63
|
load_archive
|
58
64
|
|
@@ -93,21 +99,8 @@ module PEBuild
|
|
93
99
|
global.finalize!
|
94
100
|
provision.finalize!
|
95
101
|
|
96
|
-
|
97
|
-
|
98
|
-
@config = merged
|
99
|
-
end
|
100
|
-
|
101
|
-
def prepare_answers_file
|
102
|
-
af = AnswersFile.new(@machine, @config, @work_dir)
|
103
|
-
af.generate
|
102
|
+
@config = PEBuild::Util::Config.local_merge(provision, global)
|
104
103
|
|
105
|
-
unless @config.shared_installer
|
106
|
-
@machine.communicate.upload(File.join(@answer_dir, "#{@machine.name}.txt"), "#{machine.name}.txt")
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
def load_archive
|
111
104
|
# If a version file is set, use its contents to specify the PE version.
|
112
105
|
unless @config.version_file.nil?
|
113
106
|
if URI.parse(@config.version_file).scheme.nil?
|
@@ -122,6 +115,33 @@ module PEBuild
|
|
122
115
|
|
123
116
|
raise UnsetVersionError if @config.version.nil?
|
124
117
|
|
118
|
+
if (PEBuild::Util::VersionString.compare(@config.version, '2016.2.0') >= 0)
|
119
|
+
@config.role ||= :master
|
120
|
+
else
|
121
|
+
@config.role ||= :agent
|
122
|
+
end
|
123
|
+
|
124
|
+
if (@config.role == :agent) &&
|
125
|
+
(PEBuild::Util::VersionString.compare(@config.version, '2016.2.0') >= 0)
|
126
|
+
raise AgentRoleRemovedError, machine_name: @machine.name
|
127
|
+
elsif (@config.role == :agent) &&
|
128
|
+
(PEBuild::Util::VersionString.compare(@config.version, '2015.2.0') >= 0)
|
129
|
+
@machine.ui.warn I18n.t(
|
130
|
+
'pebuild.provisioner.pe_bootstrap.warnings.agent_role_deprecated',
|
131
|
+
machine_name: @machine.name)
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
def prepare_answers_file
|
136
|
+
@answer_template = AnswersFile.new(@machine, @config, @work_dir)
|
137
|
+
@answer_template.generate
|
138
|
+
|
139
|
+
unless @config.shared_installer
|
140
|
+
@machine.communicate.upload(File.join(@answer_dir, "#{@machine.name}.txt"), "#{machine.name}.txt")
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
def load_archive
|
125
145
|
if @config.suffix == :detect and @config.filename.nil?
|
126
146
|
filename = @machine.guest.capability('detect_installer', @config.version)
|
127
147
|
else
|
@@ -161,6 +181,8 @@ module PEBuild
|
|
161
181
|
'PUPPET_MASTER_SERVER' => @config.master,
|
162
182
|
'PUPPET_AGENT_CERTNAME' => machine.name,
|
163
183
|
}
|
184
|
+
|
185
|
+
use_pem = false
|
164
186
|
else
|
165
187
|
if @config.shared_installer
|
166
188
|
root = File.join('/vagrant', PEBuild::WORK_DIR)
|
@@ -170,9 +192,17 @@ module PEBuild
|
|
170
192
|
installer_path = File.join(@archive.installer_dir, 'puppet-enterprise-installer')
|
171
193
|
answers = File.join("#{machine.name}.txt")
|
172
194
|
end
|
195
|
+
|
196
|
+
# Run a PEM install if the PE version is 2016.2.0 or newer and the
|
197
|
+
# answer file template ends in .conf.
|
198
|
+
#
|
199
|
+
# NOTE: The check for the template file ending may be dropped when
|
200
|
+
# 2016.2.0 final builds are shipped.
|
201
|
+
use_pem = (PEBuild::Util::VersionString.compare(@config.version, '2016.2.0') >= 0) &&
|
202
|
+
File.basename(@answer_template.template, '.erb').end_with?('.conf')
|
173
203
|
end
|
174
204
|
|
175
|
-
machine.guest.capability('run_install', installer_path, answers)
|
205
|
+
machine.guest.capability('run_install', installer_path, answers, use_pem: use_pem)
|
176
206
|
end
|
177
207
|
|
178
208
|
def run_postinstall_tasks
|
@@ -2,7 +2,7 @@ require 'pe_build/release'
|
|
2
2
|
|
3
3
|
module PEBuild::Release
|
4
4
|
|
5
|
-
|
5
|
+
twentysixteen_one_x = newrelease do
|
6
6
|
|
7
7
|
add_release :el, '6'
|
8
8
|
add_release :el, '7'
|
@@ -25,6 +25,7 @@ module PEBuild::Release
|
|
25
25
|
set_answer_file :agent, File.join(PEBuild.template_dir, 'answers', 'agent-2015.x.txt.erb')
|
26
26
|
end
|
27
27
|
|
28
|
-
@releases['2016.1.0'] =
|
29
|
-
@releases['2016.1.1'] =
|
28
|
+
@releases['2016.1.0'] = twentysixteen_one_x
|
29
|
+
@releases['2016.1.1'] = twentysixteen_one_x
|
30
|
+
@releases['2016.1.2'] = twentysixteen_one_x
|
30
31
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'pe_build/release'
|
2
|
+
|
3
|
+
module PEBuild::Release
|
4
|
+
|
5
|
+
twentysixteen_two_x = newrelease do
|
6
|
+
|
7
|
+
add_release :el, '6'
|
8
|
+
add_release :el, '7'
|
9
|
+
|
10
|
+
add_release :sles, '11'
|
11
|
+
add_release :sles, '12'
|
12
|
+
|
13
|
+
add_release :ubuntu, '12.04'
|
14
|
+
add_release :ubuntu, '14.04'
|
15
|
+
add_release :ubuntu, '16.04'
|
16
|
+
|
17
|
+
add_release :windows, '2008'
|
18
|
+
add_release :windows, '2008R2'
|
19
|
+
add_release :windows, '2012'
|
20
|
+
add_release :windows, '2012R2'
|
21
|
+
add_release :windows, '7'
|
22
|
+
add_release :windows, '8'
|
23
|
+
add_release :windows, '8.1'
|
24
|
+
add_release :windows, '10'
|
25
|
+
|
26
|
+
set_answer_file :master, File.join(PEBuild.template_dir, 'answers', 'master-2016.2.x.conf.erb')
|
27
|
+
end
|
28
|
+
|
29
|
+
@releases['2016.2.0'] = twentysixteen_two_x
|
30
|
+
end
|
data/lib/pe_build/release.rb
CHANGED
data/lib/pe_build/version.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
# Stock all-in-one answers for 2016.2.x and newer
|
2
|
+
"console_admin_password": "puppetlabs"
|
3
|
+
"puppet_enterprise::certificate_authority_host": "%{::trusted.certname}"
|
4
|
+
"puppet_enterprise::puppet_master_host": "%{::trusted.certname}"
|
5
|
+
"puppet_enterprise::console_host": "%{::trusted.certname}"
|
6
|
+
"puppet_enterprise::puppetdb_host": "%{::trusted.certname}"
|
7
|
+
"puppet_enterprise::database_host": "%{::trusted.certname}"
|
8
|
+
"puppet_enterprise::pcp_broker_host": "%{::trusted.certname}"
|
9
|
+
"puppet_enterprise::mcollective_middleware_hosts": ["%{::trusted.certname}"]
|
10
|
+
"puppet_enterprise::puppetdb_database_password": "1ZIhBXimu65wZtXpvMpj"
|
11
|
+
"puppet_enterprise::classifier_database_password": "mrwelwaywblIGYjpdHAa"
|
12
|
+
"puppet_enterprise::activity_database_password": "HsguT8FOfLgcQ8dpTus9"
|
13
|
+
"puppet_enterprise::rbac_database_password": "qfNllIKXaOYRaGt2ZIKU"
|
14
|
+
"puppet_enterprise::orchestrator_database_password": "kjhasdASDljhfjhkasd"
|
data/templates/locales/en.yml
CHANGED
@@ -30,10 +30,23 @@ en:
|
|
30
30
|
Applying post-install configuration to Puppet Enterprise.
|
31
31
|
already_installed: |-
|
32
32
|
Puppet Enterprise is already installed, skipping installation.
|
33
|
+
warnings:
|
34
|
+
agent_role_deprecated: |-
|
35
|
+
Agent-only installations from PE tarballs are deprecated starting
|
36
|
+
with PE 2015.2.0 and will stop working in 2016.2.0. The pe_bootstrap
|
37
|
+
provisioner on the following machine is configured for agent
|
38
|
+
installation and should be replaced with a pe_agent provisioner:
|
39
|
+
%{machine_name}
|
33
40
|
errors:
|
34
41
|
unset_version: |-
|
35
42
|
The Puppet Enterprise version must be set either on the global pe_build config
|
36
43
|
object or specified on a per-provisioner basis, but both were unset.
|
44
|
+
agent_role_removed: |-
|
45
|
+
Agent-only installations from PE tarballs are no longer supported
|
46
|
+
starting with PE 2016.2.0. The pe_bootstrap provisioner on the
|
47
|
+
following machine is configured for agent installation and should
|
48
|
+
be replaced with a pe_agent provisioner:
|
49
|
+
%{machine_name}
|
37
50
|
pe_agent:
|
38
51
|
already_installed: |-
|
39
52
|
Puppet agent %{version} is already installed, skipping installation.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-pe_build
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrien Thebo
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-05-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: progressbar
|
@@ -152,6 +152,7 @@ files:
|
|
152
152
|
- lib/pe_build/release/2015_2.rb
|
153
153
|
- lib/pe_build/release/2015_3.rb
|
154
154
|
- lib/pe_build/release/2016_1.rb
|
155
|
+
- lib/pe_build/release/2016_2.rb
|
155
156
|
- lib/pe_build/release/2_0.rb
|
156
157
|
- lib/pe_build/release/2_5.rb
|
157
158
|
- lib/pe_build/release/2_6.rb
|
@@ -197,6 +198,7 @@ files:
|
|
197
198
|
- templates/answers/master-2.0.x.txt.erb
|
198
199
|
- templates/answers/master-2.x.txt.erb
|
199
200
|
- templates/answers/master-2015.x.txt.erb
|
201
|
+
- templates/answers/master-2016.2.x.conf.erb
|
200
202
|
- templates/answers/master-3.x.txt.erb
|
201
203
|
- templates/locales/en.yml
|
202
204
|
- vagrant-pe_build.gemspec
|