Skip to content

Commit 219c27e

Browse files
Fix support for 'puppet generate types' (#6)
This works around SERVER-94 issues Puppet < 4.10.4 does not properly process the 'puppet generate types' supporting composite namevars. Closes #5
1 parent f75319e commit 219c27e

File tree

4 files changed

+49
-26
lines changed

4 files changed

+49
-26
lines changed

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sudo: required
44
rvm:
55
- 2.1.9
66
# Ruby with Puppet 5
7-
- 2.4.0
7+
- 2.4.4
88
notifications:
99
email:
1010
- raphael.pinson@camptocamp.com
@@ -13,17 +13,17 @@ env:
1313
# Test Puppet 4
1414
- PUPPET=4.0 RUBY_AUGEAS=0.5
1515
# Test Oldest Puppet, Inc. supported Puppet
16-
- PUPPET=4.7.1 RUBY_AUGEAS=0.5 FORGE_PUBLISH=true
16+
- PUPPET=4.10.4 RUBY_AUGEAS=0.5 FORGE_PUBLISH=true
1717
# Test latest Puppet version
18-
- PUPPET=5.0 RUBY_AUGEAS=0.5
18+
- PUPPET=5.5 RUBY_AUGEAS=0.5
1919

2020
matrix:
2121
fast_finish: true
2222
exclude:
2323
# base exclude
2424
# No support for Ruby 2.1.9 in Puppet 5
2525
- rvm: 2.1.9
26-
env: PUPPET=5.0 RUBY_AUGEAS=0.5
26+
env: PUPPET=5.5 RUBY_AUGEAS=0.5
2727

2828
install:
2929
- "travis_retry ./.travis.sh"

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
# Changelog
22

3+
## 3.0.0
4+
5+
- Fix support for 'puppet generate types'
6+
- Added CentOS and OracleLinux to supported OS list
7+
38
## 2.0.4
49

5-
- Upped supported Puppet versions to include Puppet 5
10+
- Upped supported Puppet versions to include Puppet 5
611

712
## 2.0.3
813

lib/puppet/type/pg_hba.rb

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ def insync?(is)
4545
munge do |value|
4646
if value.is_a? Array
4747
value
48+
elsif value.is_a? String
49+
value.split(',')
4850
else
4951
[value]
5052
end
@@ -59,6 +61,8 @@ def insync?(is)
5961
munge do |value|
6062
if value.is_a? Array
6163
value
64+
elsif value.is_a? String
65+
value.split(',')
6266
else
6367
[value]
6468
end
@@ -81,49 +85,47 @@ def insync?(is)
8185
end
8286

8387
def self.title_patterns
84-
identity = lambda { |x| x }
85-
comma_split = lambda { |x| x.split(',') }
8688
[
8789
[
8890
/^(local)\s+to\s+(\S+)\s+on\s+(\S+)\s+in\s+(.*)$/,
8991
[
90-
[ :type, identity ],
91-
[ :user, comma_split ],
92-
[ :database, comma_split ],
93-
[ :target, identity ],
92+
[ :type ],
93+
[ :user ],
94+
[ :database ],
95+
[ :target ],
9496
]
9597
],
9698
[
9799
/^(local)\s+to\s+(\S+)\s+on\s+(\S+)$/,
98100
[
99-
[ :type, identity ],
100-
[ :user, comma_split ],
101-
[ :database, comma_split ],
101+
[ :type ],
102+
[ :user ],
103+
[ :database ],
102104
]
103105
],
104106
[
105107
/^(host\S*)\s+to\s+(\S+)\s+on\s+(\S+)\s+from\s+(\S+)\s+in\s+(.*)$/,
106108
[
107-
[ :type, identity ],
108-
[ :user, comma_split ],
109-
[ :database, comma_split ],
110-
[ :address, identity ],
111-
[ :target, identity ]
109+
[ :type ],
110+
[ :user ],
111+
[ :database ],
112+
[ :address ],
113+
[ :target ]
112114
]
113115
],
114116
[
115117
/^(host\S*)\s+to\s+(\S+)\s+on\s+(\S+)\s+from\s+(\S+)$/,
116118
[
117-
[ :type, identity ],
118-
[ :user, comma_split ],
119-
[ :database, comma_split ],
120-
[ :address, identity ],
119+
[ :type ],
120+
[ :user ],
121+
[ :database ],
122+
[ :address ],
121123
]
122124
],
123125
[
124126
/(.*)/,
125127
[
126-
[ :name, identity ],
128+
[ :name ],
127129
]
128130
]
129131
]

metadata.json

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "herculesteam-augeasproviders_postgresql",
3-
"version": "2.0.4",
3+
"version": "3.0.0",
44
"author": "Dominic Cleal, Raphael Pinson",
55
"summary": "Augeas-based postgresql types and providers for Puppet",
66
"license": "Apache-2.0",
@@ -43,9 +43,25 @@
4343
"6",
4444
"7"
4545
]
46+
},
47+
{
48+
"operatingsystem": "CentOS",
49+
"operatingsystemrelease": [
50+
"4",
51+
"5",
52+
"6",
53+
"7"
54+
]
55+
},
56+
{
57+
"operatingsystem": "OracleLinux",
58+
"operatingsystemrelease": [
59+
"6",
60+
"7"
61+
]
4662
}
4763
],
4864
"requirements": [
49-
{ "name": "puppet", "version_requirement": ">= 2.7.0 < 6.0.0" }
65+
{ "name": "puppet", "version_requirement": ">= 4.10.4 < 6.0.0" }
5066
]
5167
}

0 commit comments

Comments
 (0)