kitchen-puppet 0.0.16 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- data/kitchen-puppet.gemspec +29 -29
- data/lib/kitchen/provisioner/puppet/librarian.rb +78 -83
- data/lib/kitchen/provisioner/puppet_agent.rb +218 -223
- data/lib/kitchen/provisioner/puppet_apply.rb +393 -390
- data/lib/kitchen/provisioner/puppet_apply_spec.rb +33 -33
- data/lib/kitchen-puppet/version.rb +7 -5
- data/provisioner_options.md +160 -159
- metadata +2 -2
@@ -1,33 +1,33 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
#
|
3
|
-
# Author:: Chris Lundquist (<chris.lundquist@github.com>) Neill Turner (<neillwturner@gmail.com>)
|
4
|
-
#
|
5
|
-
# Copyright (C) 2013,2014 Chris Lundquist, Neill Turner
|
6
|
-
#
|
7
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
# you may not use this file except in compliance with the License.
|
9
|
-
# You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing, software
|
14
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
# See the License for the specific language governing permissions and
|
17
|
-
# limitations under the License.
|
18
|
-
|
19
|
-
require_relative '../../spec_helper'
|
20
|
-
require 'kitchen'
|
21
|
-
|
22
|
-
# Work around for lazy loading
|
23
|
-
require 'kitchen/provisioner/puppet_apply'
|
24
|
-
|
25
|
-
describe Kitchen::Provisioner::PuppetApply do
|
26
|
-
let(:provisioner) do
|
27
|
-
Kitchen::Provisioner.for_plugin(
|
28
|
-
end
|
29
|
-
|
30
|
-
it
|
31
|
-
provisioner.run_command.must_match
|
32
|
-
end
|
33
|
-
end
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# Author:: Chris Lundquist (<chris.lundquist@github.com>) Neill Turner (<neillwturner@gmail.com>)
|
4
|
+
#
|
5
|
+
# Copyright (C) 2013,2014 Chris Lundquist, Neill Turner
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
|
19
|
+
require_relative '../../spec_helper'
|
20
|
+
require 'kitchen'
|
21
|
+
|
22
|
+
# Work around for lazy loading
|
23
|
+
require 'kitchen/provisioner/puppet_apply'
|
24
|
+
|
25
|
+
describe Kitchen::Provisioner::PuppetApply do
|
26
|
+
let(:provisioner) do
|
27
|
+
Kitchen::Provisioner.for_plugin('puppet_apply', {})
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'should give a sane run_command' do
|
31
|
+
provisioner.run_command.must_match 'puppet apply'
|
32
|
+
end
|
33
|
+
end
|
data/provisioner_options.md
CHANGED
@@ -1,160 +1,161 @@
|
|
1
|
-
|
2
|
-
# Puppet Apply Provisioner Options
|
3
|
-
|
4
|
-
key | default value | Notes
|
5
|
-
----|---------------|--------
|
6
|
-
puppet_version | "latest"| desired version, affects apt installs.
|
7
|
-
puppet_platform | naively tries to determine | OS platform of server
|
8
|
-
require_puppet_repo | true | Set if using a puppet install from yum or apt repo
|
9
|
-
puppet_apt_repo | "http://apt.puppetlabs.com/puppetlabs-release-precise.deb"| apt repo
|
10
|
-
puppet_yum_repo | "https://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm"| yum repo
|
11
|
-
require_puppet_omnibus | false | Set if using omnibus puppet install
|
12
|
-
puppet_omnibus_url | | omnibus puppet install location.
|
13
|
-
puppet_omnibus_remote_path | "/opt/puppet" | Server Installation location of an omnibus puppet install.
|
14
|
-
manifests_path | | puppet repo manifests directory
|
15
|
-
manifest | 'site.pp' | manifest for puppet apply to run
|
16
|
-
modules_path | | puppet repo manifests directory
|
17
|
-
files_path | | directory to place at /tmp/kitchen/files
|
18
|
-
fileserver_config_path | | file to place fileserver.conf
|
19
|
-
hiera_config_path | | path to hiera.yaml
|
20
|
-
hiera_data_path | | puppet repo hiera data directory
|
21
|
-
hiera_data_remote_path | "/var/lib/hiera" | Hiera data directory on server
|
22
|
-
puppet_debug| false| Enable full debugging logging on puppet run
|
23
|
-
puppet_verbose| false| Extra information logging on puppet run
|
24
|
-
puppet_noop| false| puppet runs in a no-op or dry-run mode
|
25
|
-
update_package_repos| true| update OS repository metadata
|
26
|
-
custom_facts| Hash.new | Hash to set the puppet facts before running puppet apply
|
27
|
-
chef_bootstrap_url |"https://www.getchef.com/chef/install.sh"| the chef (needed for busser to run tests)
|
28
|
-
puppetfile_path | | Path to Puppetfile
|
29
|
-
puppet_apply_command | nil | Overwrite the puppet apply command. Needs "sudo -E puppet apply" as a prefix.
|
30
|
-
require_chef_for_busser | true | Install chef as currently needed by busser to run tests
|
31
|
-
resolve_with_librarian_puppet | true | Use librarian_puppet to resolve modules if a Puppetfile is found
|
32
|
-
librarian_puppet_ssl_file | nil | ssl certificate file for librarian-puppet
|
33
|
-
puppet_config_path | | path of custom puppet.conf file
|
34
|
-
puppet_environment | nil | puppet environment for running puppet apply
|
35
|
-
remove_puppet_repo | false | remove copy of puppet repository and puppet configuration on server after running puppet
|
36
|
-
hiera_eyaml | false | use hiera-eyaml to encrypt hiera data
|
37
|
-
hiera_eyaml_key_remote_path | "/etc/puppet/secure/keys" | directory of hiera-eyaml keys on server
|
38
|
-
hiera_eyaml_key_path | "hiera_keys" | directory of hiera-eyaml keys on workstation
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
$kitchen_root/puppet/$suite_name/
|
79
|
-
$kitchen_root/puppet/$suite_name/
|
80
|
-
$kitchen_root/puppet/$suite_name/hiera
|
81
|
-
$kitchen_root/puppet/$suite_name/
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
1
|
+
|
2
|
+
# Puppet Apply Provisioner Options
|
3
|
+
|
4
|
+
key | default value | Notes
|
5
|
+
----|---------------|--------
|
6
|
+
puppet_version | "latest"| desired version, affects apt installs.
|
7
|
+
puppet_platform | naively tries to determine | OS platform of server
|
8
|
+
require_puppet_repo | true | Set if using a puppet install from yum or apt repo
|
9
|
+
puppet_apt_repo | "http://apt.puppetlabs.com/puppetlabs-release-precise.deb"| apt repo
|
10
|
+
puppet_yum_repo | "https://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm"| yum repo
|
11
|
+
require_puppet_omnibus | false | Set if using omnibus puppet install
|
12
|
+
puppet_omnibus_url | | omnibus puppet install location.
|
13
|
+
puppet_omnibus_remote_path | "/opt/puppet" | Server Installation location of an omnibus puppet install.
|
14
|
+
manifests_path | | puppet repo manifests directory
|
15
|
+
manifest | 'site.pp' | manifest for puppet apply to run
|
16
|
+
modules_path | | puppet repo manifests directory
|
17
|
+
files_path | | directory to place at /tmp/kitchen/files
|
18
|
+
fileserver_config_path | | file to place fileserver.conf
|
19
|
+
hiera_config_path | | path to hiera.yaml
|
20
|
+
hiera_data_path | | puppet repo hiera data directory
|
21
|
+
hiera_data_remote_path | "/var/lib/hiera" | Hiera data directory on server
|
22
|
+
puppet_debug| false| Enable full debugging logging on puppet run
|
23
|
+
puppet_verbose| false| Extra information logging on puppet run
|
24
|
+
puppet_noop| false| puppet runs in a no-op or dry-run mode
|
25
|
+
update_package_repos| true| update OS repository metadata
|
26
|
+
custom_facts| Hash.new | Hash to set the puppet facts before running puppet apply
|
27
|
+
chef_bootstrap_url |"https://www.getchef.com/chef/install.sh"| the chef (needed for busser to run tests)
|
28
|
+
puppetfile_path | | Path to Puppetfile
|
29
|
+
puppet_apply_command | nil | Overwrite the puppet apply command. Needs "sudo -E puppet apply" as a prefix.
|
30
|
+
require_chef_for_busser | true | Install chef as currently needed by busser to run tests
|
31
|
+
resolve_with_librarian_puppet | true | Use librarian_puppet to resolve modules if a Puppetfile is found
|
32
|
+
librarian_puppet_ssl_file | nil | ssl certificate file for librarian-puppet
|
33
|
+
puppet_config_path | | path of custom puppet.conf file
|
34
|
+
puppet_environment | nil | puppet environment for running puppet apply
|
35
|
+
remove_puppet_repo | false | remove copy of puppet repository and puppet configuration on server after running puppet
|
36
|
+
hiera_eyaml | false | use hiera-eyaml to encrypt hiera data
|
37
|
+
hiera_eyaml_key_remote_path | "/etc/puppet/secure/keys" | directory of hiera-eyaml keys on server
|
38
|
+
hiera_eyaml_key_path | "hiera_keys" | directory of hiera-eyaml keys on workstation
|
39
|
+
facter_file | nil | yaml file of custom facter_files to be provided to the puppet-apply command
|
40
|
+
|
41
|
+
## Puppet Apply Configuring Provisioner Options
|
42
|
+
|
43
|
+
The provisioner can be configured globally or per suite, global settings act as defaults for all suites, you can then customise per suite, for example:
|
44
|
+
|
45
|
+
---
|
46
|
+
driver:
|
47
|
+
name: vagrant
|
48
|
+
|
49
|
+
provisioner:
|
50
|
+
name: puppet_apply
|
51
|
+
manifests_path: /repository/puppet_repo/manifests
|
52
|
+
modules_path: /repository/puppet_repo/modules-mycompany
|
53
|
+
hiera_data_path: /repository/puppet_repo/hieradata
|
54
|
+
|
55
|
+
platforms:
|
56
|
+
- name: nocm_ubuntu-12.04
|
57
|
+
driver_plugin: vagrant
|
58
|
+
driver_config:
|
59
|
+
box: nocm_ubuntu-12.04
|
60
|
+
box_url: http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box
|
61
|
+
|
62
|
+
suites:
|
63
|
+
- name: default
|
64
|
+
|
65
|
+
|
66
|
+
in this example, vagrant will download a box for ubuntu 1204 with no configuration management installed, then install the latest puppet and puppet apply against a puppet repo from the /repository/puppet_repo directory using the defailt manifest site.pp
|
67
|
+
|
68
|
+
To override a setting at the suite-level, specify the setting name under the suite:
|
69
|
+
|
70
|
+
suites:
|
71
|
+
- name: default
|
72
|
+
manifest: foobar.pp
|
73
|
+
|
74
|
+
### Per-suite Structure
|
75
|
+
|
76
|
+
It can be beneficial to keep different Puppet layouts for different suites. Rather than having to specify the manifest, modules, etc for each suite, you can create the following directory structure and they will automatically be found:
|
77
|
+
|
78
|
+
$kitchen_root/puppet/$suite_name/manifests
|
79
|
+
$kitchen_root/puppet/$suite_name/modules
|
80
|
+
$kitchen_root/puppet/$suite_name/hiera
|
81
|
+
$kitchen_root/puppet/$suite_name/hiera.yaml
|
82
|
+
$kitchen_root/puppet/$suite_name/Puppetfile
|
83
|
+
|
84
|
+
### Puppet Version
|
85
|
+
When specifying a puppet version, you must use this format: "3.6.2-1puppetlabs1". I have
|
86
|
+
no idea why Puppet versioned their repository with a trailing
|
87
|
+
"-1puppetlabs1", but there it is.
|
88
|
+
|
89
|
+
|
90
|
+
# Puppet Agent Provisioner Options
|
91
|
+
|
92
|
+
key | default value | Notes
|
93
|
+
----|---------------|--------
|
94
|
+
puppet_version | "latest"| desired version, affects apt installs.
|
95
|
+
puppet_platform | naively tries to determine | OS platform of server
|
96
|
+
require_puppet_repo | true | Set if using a puppet install from yum or apt repo
|
97
|
+
puppet_apt_repo | "http://apt.puppetlabs.com/puppetlabs-release-precise.deb"| apt repo
|
98
|
+
puppet_yum_repo | "https://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm"| yum repo
|
99
|
+
require_puppet_omnibus | false | Set if using omnibus puppet install
|
100
|
+
puppet_omnibus_url | | omnibus puppet install location.
|
101
|
+
puppet_omnibus_remote_path | "/opt/puppet" | Server Installation location of an omnibus puppet install.
|
102
|
+
puppet_detailed_exitcodes | nil | Provide transaction information via exit codes.
|
103
|
+
puppet_logdest | nil | Where to send messages. Choose between syslog, the console, and a log file.
|
104
|
+
puppet_masterport | nil | The port on which to contact the puppet master.
|
105
|
+
puppet_test | false | Enable the most common options used for testing.
|
106
|
+
puppet_onetime | true | Run the configuration once.
|
107
|
+
puppet_no_daemonize | true | Do not send the process into the background.
|
108
|
+
puppet_server | nil | will default to 'puppet'. Useful for interactively running when used with the --no-daemonize option.
|
109
|
+
puppet_waitforcert | '0' | Time to wait for certificate if agent does not yet have certificates
|
110
|
+
puppet_certname | nil | Set the certname (unique ID) of the client
|
111
|
+
puppet_digest | nil | Change the certificate fingerprinting digest algorithm. The default is SHA256
|
112
|
+
puppet_debug| false| Enable full debugging logging on puppet run
|
113
|
+
puppet_verbose| false| Extra information logging on puppet run
|
114
|
+
puppet_noop| false| puppet runs in a no-op or dry-run mode
|
115
|
+
update_package_repos| true| update OS repository metadata
|
116
|
+
custom_facts| Hash.new | Hash to set the puppet facts before running puppet apply
|
117
|
+
chef_bootstrap_url |"https://www.getchef.com/chef/install.sh"| the chef (needed for busser to run tests)
|
118
|
+
puppet_agent_command | nil | Overwrite the puppet agent command. Needs "sudo -E puppet agent" as a prefix.
|
119
|
+
require_chef_for_busser | true | Install chef as currently needed by busser to run tests
|
120
|
+
puppet_config_path | | path of custom puppet.conf file
|
121
|
+
|
122
|
+
|
123
|
+
## Puppet Agent Configuring Provisioner Options
|
124
|
+
|
125
|
+
The provisioner can be configured globally or per suite, global settings act as defaults for all suites, you can then customise per suite, for example:
|
126
|
+
|
127
|
+
---
|
128
|
+
driver:
|
129
|
+
name: vagrant
|
130
|
+
|
131
|
+
provisioner:
|
132
|
+
name: puppet_agent
|
133
|
+
puppet_debug: true
|
134
|
+
puppet_verbose: true
|
135
|
+
puppet_server: puppetmaster-nocm-ubuntu-1204
|
136
|
+
|
137
|
+
platforms:
|
138
|
+
- name: nocm_ubuntu-12.04
|
139
|
+
driver_plugin: vagrant
|
140
|
+
driver_config:
|
141
|
+
box: nocm_ubuntu-12.04
|
142
|
+
box_url: http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box
|
143
|
+
|
144
|
+
suites:
|
145
|
+
- name: default
|
146
|
+
|
147
|
+
|
148
|
+
In this example, vagrant will download a box for ubuntu 1204 with no configuration management installed, then install the latest puppet and run puppet agent against a puppet master at puppetmaster-nocm-ubuntu-1204
|
149
|
+
|
150
|
+
NOTE: It is important that the server can resolve the hostname ip address of the puppetmaster, in this case puppetmaster-nocm-ubuntu-1204
|
151
|
+
and the puppetmaster must be able to resolve the hostname ip address address of the hostname of the node running puppet agent.
|
152
|
+
This can be done by settings in the /etc/hosts files before running puppet.
|
153
|
+
|
154
|
+
NOTE: For testing it is possible to set the puppetmaster to autosign the certificate of a node by created a file /etc/puppet/autosign.conf that contains an *.
|
155
|
+
|
156
|
+
|
157
|
+
To override a setting at the suite-level, specify the setting name under the suite:
|
158
|
+
|
159
|
+
suites:
|
160
|
+
- name: default
|
160
161
|
manifest: foobar.pp
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-10-
|
12
|
+
date: 2014-10-30 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: ! '== DESCRIPTION:
|
15
15
|
|