Skip to content

Commit d10be70

Browse files
author
Morgan Haskel
committed
Merge pull request #126 from bmjen/1.3.1-prep
1.3.1 prep
2 parents 50fa8b7 + ee5f34b commit d10be70

File tree

6 files changed

+141
-158
lines changed

6 files changed

+141
-158
lines changed

.travis.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,16 @@ script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake
66
matrix:
77
fast_finish: true
88
include:
9-
- rvm: 1.9.3
10-
env: PUPPET_GEM_VERSION="~> 3.4.0"
119
- rvm: 1.8.7
1210
env: PUPPET_GEM_VERSION="~> 3.0"
1311
- rvm: 1.9.3
1412
env: PUPPET_GEM_VERSION="~> 3.0"
15-
- rvm: 1.9.3
16-
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
1713
- rvm: 2.1.5
1814
env: PUPPET_GEM_VERSION="~> 3.0"
19-
- rvm: 2.1.5
20-
env: PUPPET_GEM_VERSION="~> 3.4.0"
2115
- rvm: 2.1.5
2216
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
17+
- rvm: 2.1.6
18+
env: PUPPET_GEM_VERSION="~> 4.0" STRICT_VARIABLES="yes"
2319
- rvm: 1.8.7
2420
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0"
2521
- rvm: 1.8.7

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
##2015-07-16 - Supported Release 1.3.1
2+
###Summary
3+
This release updates the metadata for the upcoming release of PE as well as an additional bugfixe.
4+
5+
####Bugfixes
6+
- Fixes Puppet.newtype deprecation warning
7+
18
##2015-04-14 - Supported Release 1.3.0
29
###Summary
310
Remove openssl command line tool from requirements

Gemfile

+5-4
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,21 @@ group :development, :unit_tests do
1818
gem 'json', :require => false
1919
end
2020

21-
beaker_version = ENV['BEAKER_VERSION']
22-
beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION']
2321
group :system_tests do
24-
if beaker_version
22+
if beaker_version = ENV['BEAKER_VERSION']
2523
gem 'beaker', *location_for(beaker_version)
2624
end
27-
if beaker_rspec_version
25+
if beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION']
2826
gem 'beaker-rspec', *location_for(beaker_rspec_version)
2927
else
3028
gem 'beaker-rspec', :require => false
3129
end
3230
gem 'serverspec', :require => false
31+
gem 'beaker-puppet_install_helper', :require => false
3332
end
3433

34+
35+
3536
if facterversion = ENV['FACTER_GEM_VERSION']
3637
gem 'facter', facterversion, :require => false
3738
else

lib/puppet/type/java_ks.rb

+119-121
Original file line numberDiff line numberDiff line change
@@ -1,167 +1,165 @@
1-
module Puppet
2-
newtype(:java_ks) do
3-
@doc = 'Manages the entries in a java keystore, and uses composite namevars to
4-
accomplish the same alias spread across multiple target keystores.'
1+
Puppet::Type.newtype(:java_ks) do
2+
@doc = 'Manages the entries in a java keystore, and uses composite namevars to
3+
accomplish the same alias spread across multiple target keystores.'
54

6-
ensurable do
5+
ensurable do
76

8-
desc 'Has three states: present, absent, and latest. Latest
9-
will compare the on disk MD5 fingerprint of the certificate and to that
10-
in keytool to determine if insync? returns true or false. We redefine
11-
insync? for this paramerter to accomplish this.'
7+
desc 'Has three states: present, absent, and latest. Latest
8+
will compare the on disk MD5 fingerprint of the certificate and to that
9+
in keytool to determine if insync? returns true or false. We redefine
10+
insync? for this paramerter to accomplish this.'
1211

13-
newvalue(:present) do
14-
provider.create
15-
end
12+
newvalue(:present) do
13+
provider.create
14+
end
1615

17-
newvalue(:absent) do
18-
provider.destroy
19-
end
16+
newvalue(:absent) do
17+
provider.destroy
18+
end
2019

21-
newvalue(:latest) do
22-
if provider.exists?
23-
provider.update
24-
else
25-
provider.create
26-
end
20+
newvalue(:latest) do
21+
if provider.exists?
22+
provider.update
23+
else
24+
provider.create
2725
end
26+
end
2827

29-
def insync?(is)
30-
31-
@should.each do |should|
32-
case should
33-
when :present
34-
return true if is == :present
35-
when :absent
36-
return true if is == :absent
37-
when :latest
38-
unless is == :absent
39-
return true if provider.latest == provider.current
40-
end
28+
def insync?(is)
29+
30+
@should.each do |should|
31+
case should
32+
when :present
33+
return true if is == :present
34+
when :absent
35+
return true if is == :absent
36+
when :latest
37+
unless is == :absent
38+
return true if provider.latest == provider.current
4139
end
4240
end
43-
44-
return false
4541
end
4642

47-
defaultto :present
43+
return false
4844
end
4945

50-
newparam(:name) do
51-
desc 'The alias that is used to identify the entry in the keystore. This will be
52-
converted to lowercase.'
46+
defaultto :present
47+
end
48+
49+
newparam(:name) do
50+
desc 'The alias that is used to identify the entry in the keystore. This will be
51+
converted to lowercase.'
5352

54-
isnamevar
53+
isnamevar
5554

56-
munge do |value|
57-
value.downcase
58-
end
55+
munge do |value|
56+
value.downcase
5957
end
58+
end
6059

61-
newparam(:target) do
62-
desc 'Destination file for the keystore. This will autorequire the parent directory of the file.'
60+
newparam(:target) do
61+
desc 'Destination file for the keystore. This will autorequire the parent directory of the file.'
6362

64-
isnamevar
65-
end
63+
isnamevar
64+
end
6665

67-
newparam(:certificate) do
68-
desc 'An already signed certificate that we can place in the keystore. This will autorequire the specified file.'
66+
newparam(:certificate) do
67+
desc 'An already signed certificate that we can place in the keystore. This will autorequire the specified file.'
6968

70-
isrequired
71-
end
69+
isrequired
70+
end
7271

73-
newparam(:private_key) do
74-
desc 'If you want an application to be a server and encrypt traffic,
75-
you will need a private key. Private key entries in a keystore must be
76-
accompanied by a signed certificate for the keytool provider. This will autorequire the specified file.'
77-
end
72+
newparam(:private_key) do
73+
desc 'If you want an application to be a server and encrypt traffic,
74+
you will need a private key. Private key entries in a keystore must be
75+
accompanied by a signed certificate for the keytool provider. This will autorequire the specified file.'
76+
end
7877

79-
newparam(:chain) do
80-
desc 'Some java applications do not properly send
81-
intermediary certificate authorities, in this case you can bundle them
82-
with the server certificate using chain. This will autorequire the specified file.'
83-
end
78+
newparam(:chain) do
79+
desc 'Some java applications do not properly send
80+
intermediary certificate authorities, in this case you can bundle them
81+
with the server certificate using chain. This will autorequire the specified file.'
82+
end
8483

85-
newparam(:password) do
86-
desc 'The password used to protect the keystore. If private keys are
87-
subsequently also protected this password will be used to attempt
88-
unlocking. Must be six or more characters in length. Cannot be used
89-
together with :password_file, but you must pass at least one of these parameters.'
84+
newparam(:password) do
85+
desc 'The password used to protect the keystore. If private keys are
86+
subsequently also protected this password will be used to attempt
87+
unlocking. Must be six or more characters in length. Cannot be used
88+
together with :password_file, but you must pass at least one of these parameters.'
9089

91-
validate do |value|
92-
raise Puppet::Error, "password is #{value.length} characters long; must be 6 characters or greater in length" if value.length < 6
93-
end
90+
validate do |value|
91+
raise Puppet::Error, "password is #{value.length} characters long; must be 6 characters or greater in length" if value.length < 6
9492
end
93+
end
9594

96-
newparam(:password_file) do
97-
desc 'The path to a file containing the password used to protect the
98-
keystore. This cannot be used together with :password, but you must pass at least one of these parameters.'
99-
end
95+
newparam(:password_file) do
96+
desc 'The path to a file containing the password used to protect the
97+
keystore. This cannot be used together with :password, but you must pass at least one of these parameters.'
98+
end
10099

101-
newparam(:trustcacerts) do
102-
desc "Certificate authorities aren't by default trusted so if you are adding a CA you need to set this to true.
103-
Defaults to :false."
100+
newparam(:trustcacerts) do
101+
desc "Certificate authorities aren't by default trusted so if you are adding a CA you need to set this to true.
102+
Defaults to :false."
104103

105-
newvalues(:true, :false)
104+
newvalues(:true, :false)
106105

107-
defaultto :false
108-
end
106+
defaultto :false
107+
end
109108

110-
newparam(:path) do
111-
desc "The search path used for command (keytool, openssl) execution.
112-
Paths can be specified as an array or as a '#{File::PATH_SEPARATOR}' separated list."
109+
newparam(:path) do
110+
desc "The search path used for command (keytool, openssl) execution.
111+
Paths can be specified as an array or as a '#{File::PATH_SEPARATOR}' separated list."
113112

114-
# Support both arrays and colon-separated fields.
115-
def value=(*values)
116-
@value = values.flatten.collect { |val|
117-
val.split(File::PATH_SEPARATOR)
118-
}.flatten
119-
end
113+
# Support both arrays and colon-separated fields.
114+
def value=(*values)
115+
@value = values.flatten.collect { |val|
116+
val.split(File::PATH_SEPARATOR)
117+
}.flatten
120118
end
119+
end
121120

122-
# Where we setup autorequires.
123-
autorequire(:file) do
124-
auto_requires = []
125-
[:private_key, :certificate, :chain].each do |param|
126-
if @parameters.include?(param)
127-
auto_requires << @parameters[param].value
128-
end
121+
# Where we setup autorequires.
122+
autorequire(:file) do
123+
auto_requires = []
124+
[:private_key, :certificate, :chain].each do |param|
125+
if @parameters.include?(param)
126+
auto_requires << @parameters[param].value
129127
end
130-
if @parameters.include?(:target)
131-
auto_requires << ::File.dirname(@parameters[:target].value)
132-
end
133-
auto_requires
134128
end
129+
if @parameters.include?(:target)
130+
auto_requires << ::File.dirname(@parameters[:target].value)
131+
end
132+
auto_requires
133+
end
135134

136-
# Our title_patterns method for mapping titles to namevars for supporting
137-
# composite namevars.
138-
def self.title_patterns
139-
identity = lambda {|x| x}
135+
# Our title_patterns method for mapping titles to namevars for supporting
136+
# composite namevars.
137+
def self.title_patterns
138+
identity = lambda {|x| x}
139+
[
140140
[
141+
/^([^:]+)$/,
141142
[
142-
/^([^:]+)$/,
143-
[
144-
[ :name, identity ]
145-
]
146-
],
143+
[ :name, identity ]
144+
]
145+
],
146+
[
147+
/^(.*):(.*)$/,
147148
[
148-
/^(.*):(.*)$/,
149-
[
150-
[ :name, identity ],
151-
[ :target, identity ]
152-
]
149+
[ :name, identity ],
150+
[ :target, identity ]
153151
]
154152
]
155-
end
153+
]
154+
end
156155

157-
validate do
158-
if value(:password) and value(:password_file)
159-
self.fail "You must pass either 'password' or 'password_file', not both."
160-
end
156+
validate do
157+
if value(:password) and value(:password_file)
158+
self.fail "You must pass either 'password' or 'password_file', not both."
159+
end
161160

162-
unless value(:password) or value(:password_file)
163-
self.fail "You must pass one of 'password' or 'password_file'."
164-
end
161+
unless value(:password) or value(:password_file)
162+
self.fail "You must pass one of 'password' or 'password_file'."
165163
end
166164
end
167165
end

metadata.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "puppetlabs-java_ks",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"author": "puppetlabs",
55
"summary": "Manage arbitrary Java keystore files",
66
"license": "Apache-2.0",
@@ -93,14 +93,15 @@
9393
"requirements": [
9494
{
9595
"name": "pe",
96-
"version_requirement": "3.x"
96+
"version_requirement": ">= 3.0.0 < 2015.3.0"
9797
},
9898
{
9999
"name": "puppet",
100-
"version_requirement": "3.x"
100+
"version_requirement": ">= 3.0.0 < 5.0.0"
101101
}
102102
],
103103
"description": "Uses a combination of keytool and Ruby openssl library to manage entries in a Java keystore.",
104104
"dependencies": [
105+
105106
]
106107
}

0 commit comments

Comments
 (0)