Skip to content

Commit

Permalink
Fix support for 'puppet generate types' (#6)
Browse files Browse the repository at this point in the history
This works around SERVER-94 issues

Puppet < 4.10.4 does not properly process the 'puppet generate types'
supporting composite namevars.

Closes #5
  • Loading branch information
trevor-vaughan authored May 9, 2018
1 parent f75319e commit 219c27e
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 26 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sudo: required
rvm:
- 2.1.9
# Ruby with Puppet 5
- 2.4.0
- 2.4.4
notifications:
email:
- raphael.pinson@camptocamp.com
Expand All @@ -13,17 +13,17 @@ env:
# Test Puppet 4
- PUPPET=4.0 RUBY_AUGEAS=0.5
# Test Oldest Puppet, Inc. supported Puppet
- PUPPET=4.7.1 RUBY_AUGEAS=0.5 FORGE_PUBLISH=true
- PUPPET=4.10.4 RUBY_AUGEAS=0.5 FORGE_PUBLISH=true
# Test latest Puppet version
- PUPPET=5.0 RUBY_AUGEAS=0.5
- PUPPET=5.5 RUBY_AUGEAS=0.5

matrix:
fast_finish: true
exclude:
# base exclude
# No support for Ruby 2.1.9 in Puppet 5
- rvm: 2.1.9
env: PUPPET=5.0 RUBY_AUGEAS=0.5
env: PUPPET=5.5 RUBY_AUGEAS=0.5

install:
- "travis_retry ./.travis.sh"
Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Changelog

## 3.0.0

- Fix support for 'puppet generate types'
- Added CentOS and OracleLinux to supported OS list

## 2.0.4

- Upped supported Puppet versions to include Puppet 5
- Upped supported Puppet versions to include Puppet 5

## 2.0.3

Expand Down
40 changes: 21 additions & 19 deletions lib/puppet/type/pg_hba.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def insync?(is)
munge do |value|
if value.is_a? Array
value
elsif value.is_a? String
value.split(',')
else
[value]
end
Expand All @@ -59,6 +61,8 @@ def insync?(is)
munge do |value|
if value.is_a? Array
value
elsif value.is_a? String
value.split(',')
else
[value]
end
Expand All @@ -81,49 +85,47 @@ def insync?(is)
end

def self.title_patterns
identity = lambda { |x| x }
comma_split = lambda { |x| x.split(',') }
[
[
/^(local)\s+to\s+(\S+)\s+on\s+(\S+)\s+in\s+(.*)$/,
[
[ :type, identity ],
[ :user, comma_split ],
[ :database, comma_split ],
[ :target, identity ],
[ :type ],
[ :user ],
[ :database ],
[ :target ],
]
],
[
/^(local)\s+to\s+(\S+)\s+on\s+(\S+)$/,
[
[ :type, identity ],
[ :user, comma_split ],
[ :database, comma_split ],
[ :type ],
[ :user ],
[ :database ],
]
],
[
/^(host\S*)\s+to\s+(\S+)\s+on\s+(\S+)\s+from\s+(\S+)\s+in\s+(.*)$/,
[
[ :type, identity ],
[ :user, comma_split ],
[ :database, comma_split ],
[ :address, identity ],
[ :target, identity ]
[ :type ],
[ :user ],
[ :database ],
[ :address ],
[ :target ]
]
],
[
/^(host\S*)\s+to\s+(\S+)\s+on\s+(\S+)\s+from\s+(\S+)$/,
[
[ :type, identity ],
[ :user, comma_split ],
[ :database, comma_split ],
[ :address, identity ],
[ :type ],
[ :user ],
[ :database ],
[ :address ],
]
],
[
/(.*)/,
[
[ :name, identity ],
[ :name ],
]
]
]
Expand Down
20 changes: 18 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "herculesteam-augeasproviders_postgresql",
"version": "2.0.4",
"version": "3.0.0",
"author": "Dominic Cleal, Raphael Pinson",
"summary": "Augeas-based postgresql types and providers for Puppet",
"license": "Apache-2.0",
Expand Down Expand Up @@ -43,9 +43,25 @@
"6",
"7"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"4",
"5",
"6",
"7"
]
},
{
"operatingsystem": "OracleLinux",
"operatingsystemrelease": [
"6",
"7"
]
}
],
"requirements": [
{ "name": "puppet", "version_requirement": ">= 2.7.0 < 6.0.0" }
{ "name": "puppet", "version_requirement": ">= 4.10.4 < 6.0.0" }
]
}

0 comments on commit 219c27e

Please sign in to comment.