-
-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update supported OSes in params.pp #296
update supported OSes in params.pp #296
Conversation
bd0ed8c
to
27313c7
Compare
27313c7
to
91382fb
Compare
@@ -16,98 +16,71 @@ | |||
# | |||
class openvpn::params { | |||
|
|||
case $::osfamily { | |||
'RedHat': { | |||
case $facts['os']['family'] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
structured facts \o/
'6': { | ||
$additional_packages = ['easy-rsa','openvpn-auth-ldap'] | ||
$ldap_auth_plugin_location = '/usr/lib64/openvpn/plugin/lib/openvpn-auth-ldap.so' | ||
$systemd = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion for future enhancements: $systemd
can be set to true
if the fact [service_provider
](https://github.com/puppetlabs/puppetlabs-stdlib#service_provider) returns systemd
spec/classes/openvpn_config_spec.rb
Outdated
osfamily: 'Debian', | ||
operatingsystem: 'Debian', | ||
operatingsystemrelease: '7', | ||
os: { 'family' => 'Debian' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be migrated to rspec-puppet-facts, same applies for the other spec files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, but the tag needs-work
was not useless.
I did it.
68fbe0d
to
1057c9d
Compare
spec/classes/openvpn_config_spec.rb
Outdated
context "on #{os}" do | ||
let(:facts) do | ||
facts.merge( | ||
concat_basedir: '/var/lib/puppet/concat' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test if this is required? We have mocked facts here:
puppet-openvpn/spec/default_facts.yml
Line 11 in 9f3abf6
concat_basedir: "/tmp" |
And use them here:
puppet-openvpn/spec/spec_helper.rb
Lines 25 to 35 in 9f3abf6
RSpec.configure do |c| | |
default_facts = { | |
puppetversion: Puppet.version, | |
facterversion: Facter.version | |
} | |
default_facts.merge!(YAML.load(File.read(File.expand_path('../default_facts.yml', __FILE__)))) if File.exist?(File.expand_path('../default_facts.yml', __FILE__)) | |
default_facts.merge!(YAML.load(File.read(File.expand_path('../default_module_facts.yml', __FILE__)))) if File.exist?(File.expand_path('../default_module_facts.yml', __FILE__)) | |
c.default_facts = default_facts | |
c.mock_with :rspec | |
c.hiera_config = 'spec/fixtures/hiera/hiera.yaml' | |
end |
If I see this correctly this PR doesnt add support for new operating systems, right? Otherwise the list in the metadata.json needs to be updated as well. |
1057c9d
to
9dd0d19
Compare
I created a little patch that you might want to look into: diff --git a/spec/classes/openvpn_config_spec.rb b/spec/classes/openvpn_config_spec.rb
index 10b4e73..d33e35d 100644
--- a/spec/classes/openvpn_config_spec.rb
+++ b/spec/classes/openvpn_config_spec.rb
@@ -4,12 +4,12 @@ describe 'openvpn::config', type: :class do
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
- facts.merge(
- concat_basedir: '/var/lib/puppet/concat'
- )
+ facts
end
- case facts[:os][:family]
+ it { is_expected.to compile.with_all_deps }
+
+ case facts[:os]['family']
when 'Debian'
context 'on Debian based machines' do
it { is_expected.to contain_concat('/etc/default/openvpn') } A couple of things:
|
ea78ae5
to
67f057a
Compare
67e5130
to
cae1372
Compare
Exactly . No new OS. |
@@ -454,7 +454,7 @@ | |||
Optional[String] $group = undef, | |||
Boolean $ipp = false, | |||
Boolean $duplicate_cn = false, | |||
String $local = $::ipaddress_eth0, | |||
String $local = $facts['ipaddress_eth0'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
facts hash \o/
thanks for this awesome PR! |
Pull Request (PR) description
update
params.pp
to be up to date with currentmetadata.json
This Pull Request (PR) fixes the following issues
Fixes #291