Skip to content

Commit c75750e

Browse files
committed
Implement psmodule as a package;
Need to add bootstrapping of the nuget provider
1 parent c7cabdb commit c75750e

File tree

14 files changed

+423
-129
lines changed

14 files changed

+423
-129
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.kitchen/
2+
.kitchen.local.yml

.kitchen.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
driver:
3+
name: azurerm
4+
5+
driver_config:
6+
subscription_id: 'bab9ed05-2c6e-4631-a0cf-7373c33838cc'
7+
location: 'North Europe'
8+
machine_size: 'Standard_F2s'
9+
storage_account_type: 'Premium_LRS'
10+
boot_diagnostics_enabled: 'false'
11+
12+
provisioner:
13+
name: puppet_apply
14+
manifests_path: spec/manifests
15+
modules_path: .kitchen-modules
16+
require_chef_for_busser: false
17+
resolve_with_librarian_puppet: false
18+
require_puppet_collections: true
19+
puppet_whitelist_exit_code: [0]
20+
puppet_detailed_exitcodes: true
21+
retry_on_exit_code: [2]
22+
wait_for_retry: 10
23+
puppet_version: 'latest'
24+
25+
platforms:
26+
- name: windows2016
27+
driver_config:
28+
image_urn: MicrosoftWindowsServer:WindowsServer:2016-Datacenter:latest
29+
transport:
30+
name: winrm
31+
32+
verifier:
33+
name: pester
34+
use_local_pester_module: true
35+
test_folder: ./spec/acceptance
36+
37+
suites:
38+
- name: default

Gemfile

+7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ gem 'puppetlabs_spec_helper', '>= 1.0.0'
77
gem 'puppet-lint', '>= 1.0.0'
88
gem 'facter', '>= 1.7.0'
99
gem 'rspec-puppet'
10+
gem 'test-kitchen'
11+
gem 'kitchen-puppet'
12+
gem 'kitchen-azurerm'
13+
gem 'kitchen-pester'
14+
gem 'winrm'
15+
gem 'winrm-fs'
16+
gem 'r10k'
1017

1118
# rspec must be v2 for ruby 1.8.7
1219
if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9'

Gemfile.lock

+231
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
artifactory (2.5.2)
5+
ast (2.3.0)
6+
azure_mgmt_network (0.8.0)
7+
ms_rest_azure (~> 0.6.2)
8+
azure_mgmt_resources (0.8.0)
9+
ms_rest_azure (~> 0.6.2)
10+
builder (3.2.3)
11+
colored (1.2)
12+
concurrent-ruby (1.0.4)
13+
cri (2.6.1)
14+
colored (~> 1.2)
15+
diff-lcs (1.3)
16+
domain_name (0.5.20161129)
17+
unf (>= 0.0.5, < 1.0.0)
18+
erubis (2.7.0)
19+
facter (2.4.6-x86-mingw32)
20+
ffi (~> 1.9.5)
21+
win32-dir (~> 0.4.8)
22+
win32-security (~> 0.2.5)
23+
win32console (~> 1.3.2)
24+
faraday (0.9.2)
25+
multipart-post (>= 1.2, < 3)
26+
faraday-cookie_jar (0.0.6)
27+
faraday (>= 0.7.4)
28+
http-cookie (~> 1.0.0)
29+
faraday_middleware (0.10.1)
30+
faraday (>= 0.7.4, < 1.0)
31+
fast_gettext (1.1.0)
32+
ffi (1.9.17-x86-mingw32)
33+
gettext (3.2.2)
34+
locale (>= 2.0.5)
35+
text (>= 1.3.0)
36+
gettext-setup (0.13)
37+
fast_gettext (~> 1.1.0)
38+
gettext (>= 3.0.2)
39+
locale
40+
gssapi (1.2.0)
41+
ffi (>= 1.0.1)
42+
gyoku (1.3.1)
43+
builder (>= 2.1.2)
44+
hiera (3.2.2-x86-mingw32)
45+
win32-dir (~> 0.4.8)
46+
win32console (= 1.3.2)
47+
http-cookie (1.0.3)
48+
domain_name (~> 0.5)
49+
httpclient (2.8.3)
50+
inifile (3.0.0)
51+
json (2.0.3)
52+
json_pure (1.8.6)
53+
kitchen-azurerm (0.8.0)
54+
azure_mgmt_network (~> 0.5, >= 0.5.0)
55+
azure_mgmt_resources (~> 0.5, >= 0.5.0)
56+
inifile (~> 3.0, >= 3.0.0)
57+
sshkey (~> 1, >= 1.0.0)
58+
kitchen-pester (0.7.1)
59+
test-kitchen (~> 1.4)
60+
kitchen-puppet (1.46.3)
61+
net-ssh (~> 3)
62+
test-kitchen (~> 1.4)
63+
little-plugger (1.1.4)
64+
locale (2.1.2)
65+
log4r (1.1.10)
66+
logging (2.1.0)
67+
little-plugger (~> 1.1)
68+
multi_json (~> 1.10)
69+
metaclass (0.0.4)
70+
metadata-json-lint (1.0.0)
71+
json
72+
semantic_puppet (>= 0.1.2, < 2.0.0)
73+
spdx-licenses (~> 1.0)
74+
minitar (0.5.4)
75+
mixlib-install (2.1.10)
76+
artifactory
77+
mixlib-shellout
78+
mixlib-versioning
79+
thor
80+
mixlib-shellout (2.2.1-universal-mingw32)
81+
win32-process (~> 0.7.5)
82+
mixlib-versioning (1.1.0)
83+
mocha (1.2.1)
84+
metaclass (~> 0.0.1)
85+
ms_rest (0.6.2)
86+
concurrent-ruby (~> 1.0)
87+
faraday (~> 0.9)
88+
timeliness (~> 0.3)
89+
ms_rest_azure (0.6.2)
90+
concurrent-ruby (~> 1.0)
91+
faraday (~> 0.9)
92+
faraday-cookie_jar (~> 0.0.6)
93+
ms_rest (~> 0.6.2)
94+
multi_json (1.12.1)
95+
multipart-post (2.0.0)
96+
net-scp (1.2.1)
97+
net-ssh (>= 2.6.5)
98+
net-ssh (3.2.0)
99+
net-ssh-gateway (1.3.0)
100+
net-ssh (>= 2.6.5)
101+
nori (2.6.0)
102+
parser (2.3.3.1)
103+
ast (~> 2.2)
104+
powerpack (0.1.1)
105+
puppet (4.8.2-x86-mingw32)
106+
facter (> 2.0, < 4)
107+
ffi (~> 1.9.6)
108+
hiera (>= 2.0, < 4)
109+
json_pure (~> 1.8)
110+
minitar (~> 0.5.4)
111+
win32-dir (= 0.4.9)
112+
win32-eventlog (= 0.6.5)
113+
win32-process (= 0.7.5)
114+
win32-security (= 0.2.5)
115+
win32-service (= 0.8.8)
116+
puppet-lint (2.1.0)
117+
puppet-syntax (2.2.0)
118+
rake
119+
puppet_forge (2.2.3)
120+
faraday (~> 0.9.0)
121+
faraday_middleware (>= 0.9.0, < 0.11.0)
122+
gettext-setup (~> 0.11)
123+
minitar
124+
semantic_puppet (~> 0.1.0)
125+
puppetlabs_spec_helper (1.2.2)
126+
mocha (~> 1.0)
127+
puppet-lint (~> 2.0)
128+
puppet-syntax (~> 2.0)
129+
rspec-puppet (~> 2.0)
130+
r10k (2.5.1)
131+
colored (= 1.2)
132+
cri (~> 2.6.1)
133+
gettext-setup (~> 0.5)
134+
log4r (= 1.1.10)
135+
minitar
136+
multi_json (~> 1.10)
137+
puppet_forge (~> 2.2)
138+
semantic_puppet (~> 0.1.0)
139+
rainbow (2.2.1)
140+
rake (12.0.0)
141+
rspec (3.5.0)
142+
rspec-core (~> 3.5.0)
143+
rspec-expectations (~> 3.5.0)
144+
rspec-mocks (~> 3.5.0)
145+
rspec-core (3.5.4)
146+
rspec-support (~> 3.5.0)
147+
rspec-expectations (3.5.0)
148+
diff-lcs (>= 1.2.0, < 2.0)
149+
rspec-support (~> 3.5.0)
150+
rspec-mocks (3.5.0)
151+
diff-lcs (>= 1.2.0, < 2.0)
152+
rspec-support (~> 3.5.0)
153+
rspec-puppet (2.5.0)
154+
rspec
155+
rspec-support (3.5.0)
156+
rubocop (0.47.1)
157+
parser (>= 2.3.3.1, < 3.0)
158+
powerpack (~> 0.1)
159+
rainbow (>= 1.99.1, < 3.0)
160+
ruby-progressbar (~> 1.7)
161+
unicode-display_width (~> 1.0, >= 1.0.1)
162+
ruby-progressbar (1.8.1)
163+
rubyntlm (0.6.1)
164+
rubyzip (1.2.0)
165+
safe_yaml (1.0.4)
166+
semantic_puppet (0.1.4)
167+
gettext-setup (>= 0.3)
168+
spdx-licenses (1.1.0)
169+
sshkey (1.9.0)
170+
test-kitchen (1.15.0)
171+
mixlib-install (>= 1.2, < 3.0)
172+
mixlib-shellout (>= 1.2, < 3.0)
173+
net-scp (~> 1.1)
174+
net-ssh (>= 2.9, < 5.0)
175+
net-ssh-gateway (~> 1.2)
176+
safe_yaml (~> 1.0)
177+
thor (~> 0.18)
178+
text (1.3.1)
179+
thor (0.19.4)
180+
timeliness (0.3.8)
181+
unf (0.1.4)
182+
unf_ext
183+
unf_ext (0.0.7.2-x86-mingw32)
184+
unicode-display_width (1.1.3)
185+
win32-dir (0.4.9)
186+
ffi (>= 1.0.0)
187+
win32-eventlog (0.6.5)
188+
ffi
189+
win32-process (0.7.5)
190+
ffi (>= 1.0.0)
191+
win32-security (0.2.5)
192+
ffi
193+
win32-service (0.8.8)
194+
ffi
195+
win32console (1.3.2-x86-mingw32)
196+
winrm (2.1.2)
197+
builder (>= 2.1.2)
198+
erubis (~> 2.7)
199+
gssapi (~> 1.2)
200+
gyoku (~> 1.0)
201+
httpclient (~> 2.2, >= 2.2.0.2)
202+
logging (>= 1.6.1, < 3.0)
203+
nori (~> 2.0)
204+
rubyntlm (~> 0.6.0, >= 0.6.1)
205+
winrm-fs (1.0.1)
206+
erubis (~> 2.7)
207+
logging (>= 1.6.1, < 3.0)
208+
rubyzip (~> 1.1)
209+
winrm (~> 2.0)
210+
211+
PLATFORMS
212+
x86-mingw32
213+
214+
DEPENDENCIES
215+
facter (>= 1.7.0)
216+
kitchen-azurerm
217+
kitchen-pester
218+
kitchen-puppet
219+
metadata-json-lint
220+
puppet (>= 3.3)
221+
puppet-lint (>= 1.0.0)
222+
puppetlabs_spec_helper (>= 1.0.0)
223+
r10k
224+
rspec-puppet
225+
rubocop
226+
test-kitchen
227+
winrm
228+
winrm-fs
229+
230+
BUNDLED WITH
231+
1.13.6

Rakefile

+7
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,10 @@ task :test do
3030
Rake::Task[test].invoke
3131
end
3232
end
33+
34+
begin
35+
require 'kitchen/rake_tasks'
36+
Kitchen::RakeTasks.new
37+
rescue LoadError
38+
puts '>>>>> Kitchen gem not loaded, omitting tasks' unless ENV['CI']
39+
end

examples/init.pp

+20-12
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,26 @@
99
# Learn more about module testing here:
1010
# https://docs.puppet.com/guides/tests_smoke.html
1111
#
12-
psrepository { 'PSGallery':
13-
ensure => present,
14-
source_location => 'https://www.powershellgallery.com/api/v2/',
15-
installation_policy => 'untrusted',
16-
}
12+
#psrepository { 'PSGallery':
13+
# ensure => present,
14+
# source_location => 'https://www.powershellgallery.com/api/v2/',
15+
# installation_policy => 'untrusted',
16+
#}
17+
18+
#resources { 'psrepository':
19+
# purge => true,
20+
#}
1721

18-
resources { 'psrepository':
19-
purge => true,
22+
powershellmodule { 'psexcel1':
23+
ensure => present,
24+
version => '1.0.2',
25+
repository => 'psgallery',
26+
name => 'psexcel',
2027
}
2128

22-
#powershellmodule { 'psexcel':
23-
# ensure => absent,
24-
# version => '1.0.2',
25-
# repository => 'psgallery',
26-
#}
29+
powershellmodule { 'psexcel2':
30+
ensure => present,
31+
version => '1.0.1',
32+
repository => 'psgallery',
33+
name => 'psexcel',
34+
}

0 commit comments

Comments
 (0)