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

Migrate to puppet4 datatypes #1621

Merged
merged 23 commits into from Jul 14, 2017

Conversation

Projects
None yet
4 participants
@bastelfreak
Copy link
Contributor

bastelfreak commented May 11, 2017

goal of this is to get rid of all the legacy valida_* function calls, and not to provide perfect datatypes for all parameters.

@bastelfreak bastelfreak changed the title Introduce Puppet 4 datatypes [WIP]Introduce Puppet 4 datatypes May 11, 2017

@bastelfreak bastelfreak force-pushed the bastelfreak:puppet4 branch 6 times, most recently from 4484ca0 to e1c657f May 11, 2017

$default_type = 'none',
$dev_packages = $::apache::params::dev_packages,
$ip = undef,
Boolean$service_enable = true,

This comment has been minimized.

@alexjfisher

alexjfisher May 12, 2017

Contributor

Missing space

$verify_server_cert = true,
$verifyServerCert = undef,
$package_name = undef,
Boolean$verify_server_cert = true,

This comment has been minimized.

@alexjfisher

alexjfisher May 12, 2017

Contributor

Missing space

@@ -1,10 +1,8 @@
class apache::mod::dumpio(
$dump_io_input = 'Off',
$dump_io_output = 'Off',
Enum['Off', 'On'] $dump_io_input = 'Off',

This comment has been minimized.

@alexjfisher

alexjfisher May 12, 2017

Contributor

Lowercase versions are also allowed

::apache::mod { 'ldap':
package => $package_name,
package => $package_name,

This comment has been minimized.

@alexjfisher
$passenger_max_instances_per_app = undef,
$passenger_use_global_queue = undef,
$passenger_app_env = undef,
Optional[Stdlib::AbsolutAbsoluteppath] $passenger_log_file = undef,

This comment has been minimized.

@alexjfisher

alexjfisher May 12, 2017

Contributor

Type typo?

) inherits apache::params {
include ::apache
$mod = "php${php_version}"
$mod = "php${php_version}"

This comment has been minimized.

@alexjfisher
$apache_version = undef,
$status_path = '/server-status',
Array $allow_from = ['127.0.0.1','::1'],
Enum['On', 'Off'] $extended_status = 'On',

This comment has been minimized.

@alexjfisher

alexjfisher May 12, 2017

Contributor

Lowercase is currently allowed too

case $service_ensure {
true, false, 'running', 'stopped': {
$_service_ensure = $service_ensure
$_service_ensure = $service_ensure

This comment has been minimized.

@alexjfisher
}
default: {
$_service_ensure = undef
$_service_ensure = undef

This comment has been minimized.

@alexjfisher
$modsec_audit_log_file = undef,
$modsec_audit_log_pipe = undef,
$error_documents = [],
Variant[Stdlib::Absolutepath, Enum['disabled']] $fallbackresource = undef,

This comment has been minimized.

@alexjfisher

alexjfisher May 12, 2017

Contributor

Also 'Optional'?

This comment has been minimized.

@bastelfreak

bastelfreak May 15, 2017

Author Contributor

fixed

@bastelfreak bastelfreak force-pushed the bastelfreak:puppet4 branch from e1c657f to b058b86 May 12, 2017

@@ -107,10 +99,6 @@
validate_re($mpm_module, $valid_mpms_re)

This comment has been minimized.

@ekohl

ekohl May 12, 2017

Contributor

Would assert_type(Pattern[$valid_mpms_re], $mpm_module) be better here?

This comment has been minimized.

@bastelfreak

bastelfreak May 12, 2017

Author Contributor

thanks, updated

$passenger_max_instances_per_app = undef,
$passenger_use_global_queue = undef,
$passenger_app_env = undef,
Optional[Stdlib::Absoluteppath] $passenger_log_file = undef,

This comment has been minimized.

@ekohl

ekohl May 12, 2017

Contributor

typo in ppath

This comment has been minimized.

@bastelfreak

bastelfreak May 15, 2017

Author Contributor

fixed

{"name":"puppetlabs/stdlib","version_requirement":">= 4.2.0 < 5.0.0"},
{"name":"puppetlabs/concat","version_requirement":">= 1.1.1 < 3.0.0"}
{"name":"puppetlabs/stdlib","version_requirement":">= 4.13.1 < 5.0.0"},
{"name":"puppetlabs/concat","version_requirement":">= 2.2.1 < 3.0.0"}

This comment has been minimized.

@ekohl

ekohl May 12, 2017

Contributor

Does this work with version 4.0.0 as well?

This comment has been minimized.

@bastelfreak

bastelfreak May 15, 2017

Author Contributor

stdlib 4.0? No. 4.13.1 was the first useable version with the pupept4 types uses here

This comment has been minimized.

@ekohl

ekohl May 15, 2017

Contributor

I meant concat. It's now pinned to < 3.0.0 but I think it can be < 5.0.0 so it can use Puppet 4 types there as well.

This comment has been minimized.

@bastelfreak

bastelfreak May 15, 2017

Author Contributor

ah right. the apache module + concat4 works fine on my environment. But I'm not sure if bumping it should be part of this PR.

@bastelfreak bastelfreak force-pushed the bastelfreak:puppet4 branch 5 times, most recently from f4f30d7 to b0ef81e May 15, 2017

@bastelfreak bastelfreak changed the title [WIP]Introduce Puppet 4 datatypes Migrate to puppet4 datatypes May 21, 2017


if $allow_encoded_slashes {
validate_re($allow_encoded_slashes, '(^on$|^off$|^nodecode$)', "${allow_encoded_slashes} is not permitted for allow_encoded_slashes. Allowed values are 'on', 'off' or 'nodecode'.")
assert_type(Pattern[$valid_mpms_re], $mpm_module)

This comment has been minimized.

@ekohl

ekohl May 21, 2017

Contributor

I wonder if this could be rewritten to an Enum. That's most likely an easier to read error.

$apache_version = undef,
$package_name = undef,
$ldap_trusted_global_cert_file = undef,
Optional[String] $ldap_trusted_global_cert_type = 'CA_BASE64',

This comment has been minimized.

@ekohl

ekohl May 21, 2017

Contributor

Given there's a default value, does the Optional part even make sense?


validate_array($ssl_proxy_protocol)
validate_string($ssl_sessioncache)

if is_bool($ssl_honorcipherorder) {

This comment has been minimized.

@ekohl

ekohl May 21, 2017

Contributor

Maybe this can be one big switch statement that includes true and false because I believe is_bool also emits a deprecation warning.

) {

# The base class must be included first because parameter defaults depend on it
if ! defined(Class['apache::params']) {

This comment has been minimized.

@ekohl

ekohl May 21, 2017

Contributor

I think this can be removed if you use the String[1] type for $service_name.

@bastelfreak bastelfreak force-pushed the bastelfreak:puppet4 branch 2 times, most recently from 5b19458 to b285987 Jul 12, 2017

bastelfreak added some commits May 11, 2017

bastelfreak added some commits May 11, 2017

@bastelfreak bastelfreak force-pushed the bastelfreak:puppet4 branch from b285987 to 62ac72b Jul 14, 2017

@eputnam eputnam merged commit 500ccf9 into puppetlabs:master Jul 14, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@bastelfreak bastelfreak deleted the bastelfreak:puppet4 branch Jul 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment