-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
Data in Modules, Modern facts & Cleanup #305
Conversation
3112cad
to
ed49b84
Compare
532fb76
to
0ea62ba
Compare
Dockerfile
Outdated
@@ -0,0 +1,17 @@ | |||
FROM ruby:2.4 |
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.
I'm not sure if we want a Dockerfile. If so, we should probably contribute it to https://github.com/voxpupuli/modulesync_config/tree/master/moduleroot
manifests/deploy/prepare.pp
Outdated
|
||
class { 'openvpn::params': } | ||
class openvpn::deploy::prepare( | ||
String $etc_directory, |
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.
We can validate this even stricter:
String $etc_directory, | |
Stdlib::Absolutepath $etc_directory, |
manifests/init.pp
Outdated
Hash $servers = {}, | ||
Boolean $autostart_all, | ||
Boolean $manage_service, | ||
String $etc_directory, |
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.
String $etc_directory, | |
Stdlib::Absolutepath $etc_directory, |
manifests/init.pp
Outdated
Boolean $autostart_all, | ||
Boolean $manage_service, | ||
String $etc_directory, | ||
String $group, |
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.
String $group, | |
String[1] $group, |
manifests/init.pp
Outdated
Boolean $namespecific_rclink, | ||
Pattern[/^[23]\.0$/] $default_easyrsa_ver, | ||
Stdlib::Unixpath $easyrsa_source, | ||
Variant[String, Array] $additional_packages, |
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.
Variant[String, Array] $additional_packages, | |
Variant[String[1], Array[String[1]]] $additional_packages, |
manifests/install.pp
Outdated
|
||
ensure_packages(['openvpn']) | ||
if $::openvpn::params::additional_packages != undef { | ||
ensure_packages( any2array($::openvpn::params::additional_packages) ) | ||
if $openvpn::additional_packages != undef { |
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 could be simplified to:
if $openvpn::additional_packages != undef { | |
if $openvpn::additional_packages { |
data/defaults.yaml
Outdated
openvpn::easyrsa_source: '/usr/share/easy-rsa/' | ||
openvpn::additional_packages: ['easy-rsa'] | ||
openvpn::ldap_auth_plugin_location: ~ | ||
openvpn::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.
Do we need this parameter?
$ git grep systemd
CHANGELOG.md:* Add systemd support for Debian >= 8.0 ([#161](https://github.com/luxflux/puppet-openvpn/pull/161))
CHANGELOG.md:* Support for systemd ([#127](https://github.com/luxflux/puppet-openvpn/pull/127))
HISTORY.md:* Add systemd support for Debian >= 8.0 ([#161](https://github.com/luxflux/puppet-openvpn/pull/161))
HISTORY.md:* Support for systemd ([#127](https://github.com/luxflux/puppet-openvpn/pull/127))
data/defaults.yaml:openvpn::systemd: false
manifests/init.pp: if $facts['service_provider'] != 'systemd' {
manifests/server.pp: if $facts['service_provider'] == 'systemd' and $openvpn::namespecific_rclink {
manifests/server.pp: fail("Using systemd and namespecific rclink's (BSD-style) is not allowed")
manifests/server.pp: if $facts['service_provider'] == 'systemd' {
manifests/server.pp: if $facts['service_provider'] == 'systemd' {
manifests/server.pp: provider => 'systemd',
spec/classes/openvpn_init_spec.rb: context 'system without systemd' do
spec/classes/openvpn_init_spec.rb: service_provider: 'systemd'
spec/classes/openvpn_init_spec.rb: context 'system with systemd' do
Fixes #306 |
Thanks for the awesome PR @jkroepke. I only did some little inline comments, but I didn't spot anything bad. Can you also add Ubuntu 18.04 to our acceptance test matrix? That would be: diff --git a/.sync.yml b/.sync.yml
index d485814..e241dff 100644
--- a/.sync.yml
+++ b/.sync.yml
@@ -1,6 +1,7 @@
---
.travis.yml:
docker_sets:
+ - set: ubuntu1804-64
- set: ubuntu1604-64
- set: ubuntu1404-64
- set: centos7-64
diff --git a/.travis.yml b/.travis.yml
index 1b0d04c..3566dc8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -25,6 +25,24 @@ matrix:
- rvm: 2.4.4
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
+ - rvm: 2.5.1
+ bundler_args: --without development release
+ dist: trusty
+ env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=ubuntu1804-64{hypervisor=docker} CHECK=beaker
+ services: docker
+ sudo: required
+ - rvm: 2.5.1
+ bundler_args: --without development release
+ dist: trusty
+ env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=ubuntu1804-64{hypervisor=docker} CHECK=beaker
+ services: docker
+ sudo: required
+ - rvm: 2.5.1
+ bundler_args: --without development release
+ dist: trusty
+ env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=ubuntu1804-64{hypervisor=docker} CHECK=beaker
+ services: docker
+ sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty If that doesn't work we can still implement it in another PR, to keep the diff small in this one. |
Thanks for the reviews! @bastelfreak about the acceptance test. I would add it but I can not find a nodeset for 1804 here. Is this correct? |
The nodesets for docker are generated on the fly. It's triggered by |
033756a
to
b28d69b
Compare
* Add Data in modules * Remove root_group parameter * Removed top scope variables * Removed create_resources * Removed params.pp * Remove systemd option in favor of facts provided by stdlib
b28d69b
to
2e981b9
Compare
@@ -354,7 +354,7 @@ | |||
|
|||
file { "${etc_directory}/openvpn/${server}/download-configs/${name}/${name}.conf": | |||
owner => root, | |||
group => $::openvpn::params::root_group, | |||
group => 0, |
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.
Why did you switch away from the parameter to a hardcoded number? I don't think that there are a lot of usecases to set this to something else, but since the parameter is already there we could keep it?
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.
I would prefer to keep it, because the root group is always 0.
But its backwards-incompatible
, expect you want this parameter.
Co-Authored-By: jkroepke <[email protected]>
Co-Authored-By: jkroepke <[email protected]>
class { 'openvpn::service': | ||
subscribe => [Class['openvpn::config'], Class['openvpn::install'] ], | ||
} | ||
|
||
if empty($servers) { |
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.
@bastelfreak What about this?
It can be just if !$servers
or if $servers != {}
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.
mhm, good question. We don't have anything for this in our styleguide. On a first guess empty($servers)
looks as good as if !$servers
.
I am fine with this as is, but would like to see another review |
Interesting PR, thank you. |
PR is still in progress.
Reviews are welcome.
Pull Request (PR) description
This Pull Request (PR) fixes the following issues
Fixes #304
Tested