-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add puppet8 / data types support #38
base: develop
Are you sure you want to change the base?
Changes from 4 commits
09cf733
cb796bf
15cc7b8
1c5f155
418f364
1390e9a
38ace62
a325640
726468e
e7cdf20
89814aa
65ad184
c71c2a1
44d23f7
0c33fee
15df0ee
d084b5c
a5905ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,31 +84,31 @@ | |
# Copyright 2016 Modestas Vainius. | ||
# Copyright (c) IN2P3 Computing Centre, IN2P3, CNRS | ||
# | ||
define mit_krb5::dbmodules( | ||
String $realm = $title, | ||
$database_name = '', | ||
$db_library = '', | ||
$disable_last_success = '', | ||
$disable_lockout = '', | ||
$ldap_cert_path = '', | ||
$ldap_conns_per_server = '', | ||
$ldap_kadmind_dn = '', | ||
$ldap_kdc_dn = '', | ||
$ldap_kerberos_container_dn = '', | ||
$ldap_servers = '', | ||
$ldap_service_password_file = '', | ||
define mit_krb5::dbmodules ( | ||
String $realm = $title, | ||
Optional[String] $database_name = undef, | ||
Optional[String] $db_library = undef, | ||
Optional[Boolean] $disable_last_success = undef, | ||
Optional[Boolean] $disable_lockout = undef, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
Optional[String] $ldap_cert_path = undef, | ||
Optional[String] $ldap_conns_per_server = undef, | ||
Optional[String] $ldap_kadmind_dn = undef, | ||
Optional[String] $ldap_kdc_dn = undef, | ||
Optional[String] $ldap_kerberos_container_dn = undef, | ||
Optional[String] $ldap_servers = undef, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be a |
||
Optional[String] $ldap_service_password_file = undef, | ||
) { | ||
include mit_krb5 | ||
ensure_resource('concat::fragment', 'mit_krb5::dbmodules_header', { | ||
target => $mit_krb5::krb5_conf_path, | ||
order => '30dbmodules_header', | ||
content => "\n[dbmodules]\n", | ||
target => $mit_krb5::krb5_conf_path, | ||
order => '30dbmodules_header', | ||
content => "\n[dbmodules]\n", | ||
}) | ||
if (! empty($mit_krb5::db_module_dir)) { | ||
ensure_resource('concat::fragment', 'mit_krb5::dbmodules_db_module_dir', { | ||
target => $mit_krb5::krb5_conf_path, | ||
order => '31dbmodules_db_module_dir', | ||
content => " db_module_dir = ${mit_krb5::db_module_dir}\n", | ||
target => $mit_krb5::krb5_conf_path, | ||
order => '31dbmodules_db_module_dir', | ||
content => " db_module_dir = ${mit_krb5::db_module_dir}\n", | ||
}) | ||
} | ||
concat::fragment { "mit_krb5::dbmodules::${realm}": | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -226,6 +226,20 @@ | |
# [*krb5_conf_mode*] | ||
# File mode for krb5.conf. (Default: 0444) | ||
# | ||
# [*alter_etc_services*] | ||
# | ||
# [*domain_realms*] | ||
# | ||
# [*capaths*] | ||
# | ||
# [*appdefaults*] | ||
# | ||
# [*realms*] | ||
# | ||
# [*dbmodules*] | ||
# | ||
# [*krb5_conf_warn*] | ||
# | ||
# === Examples | ||
# | ||
# class { 'mit_krb5': | ||
|
@@ -241,57 +255,57 @@ | |
# Copyright 2013 Patrick Mooney. | ||
# Copyright (c) IN2P3 Computing Centre, IN2P3, CNRS | ||
# | ||
class mit_krb5( | ||
String $default_realm = '', | ||
String $default_keytab_name = '', | ||
$default_tgs_enctypes = [], | ||
$default_tkt_enctypes = [], | ||
String $default_ccache_name = '', | ||
$permitted_enctypes = [], | ||
$allow_weak_crypto = '', | ||
String $clockskew = '', | ||
$ignore_acceptor_hostname = '', | ||
$k5login_authoritative = '', | ||
String $k5login_directory = '', | ||
String $kdc_timesync = '', | ||
String $kdc_req_checksum_type = '', | ||
String $ap_req_checksum_type = '', | ||
String $safe_checksum_type = '', | ||
String $preferred_preauth_types = '', | ||
String $ccache_type = '', | ||
$canonicalize = '', | ||
$dns_canonicalize_hostname = '', | ||
$dns_lookup_kdc = '', | ||
$dns_lookup_realm = '', | ||
$dns_fallback = '', | ||
String $realm_try_domains = '', | ||
$extra_addresses = [], | ||
String $udp_preference_limit = '', | ||
$verify_ap_req_nofail = '', | ||
String $ticket_lifetime = '', | ||
String $renew_lifetime = '', | ||
$noaddresses = '', | ||
$forwardable = '', | ||
$proxiable = '', | ||
$rdns = '', | ||
$pkinit_anchors = '', | ||
$spake_preauth_groups = '', | ||
String $plugin_base_dir = '', | ||
$include = '', | ||
$includedir = '', | ||
$module = '', | ||
String $db_module_dir = '', | ||
String $krb5_conf_path = '/etc/krb5.conf', | ||
String $krb5_conf_owner = 'root', | ||
String $krb5_conf_group = 'root', | ||
String $krb5_conf_mode = '0444', | ||
Boolean $alter_etc_services = false, | ||
Boolean $krb5_conf_warn = true, | ||
Hash $domain_realms = {}, | ||
Hash $capaths = {}, | ||
Hash $appdefaults = {}, | ||
Hash $realms = {}, | ||
Hash $dbmodules = {} | ||
class mit_krb5 ( | ||
Optional[String] $default_realm = undef, | ||
Optional[String] $default_keytab_name = undef, | ||
Array $default_tgs_enctypes = [], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be |
||
Array $default_tkt_enctypes = [], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be |
||
Optional[String] $default_ccache_name = undef, | ||
Array $permitted_enctypes = [], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be |
||
Optional[Boolean] $allow_weak_crypto = undef, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
Optional[String] $clockskew = undef, | ||
Optional[String] $ignore_acceptor_hostname = undef, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be |
||
Optional[String] $k5login_authoritative = undef, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be |
||
Optional[String] $k5login_directory = undef, | ||
Optional[String] $kdc_timesync = undef, | ||
Optional[String] $kdc_req_checksum_type = undef, | ||
Optional[String] $ap_req_checksum_type = undef, | ||
Optional[String] $safe_checksum_type = undef, | ||
Optional[String] $preferred_preauth_types = undef, | ||
Optional[String] $ccache_type = undef, | ||
Optional[String] $canonicalize = undef, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be |
||
Optional[Boolean] $dns_canonicalize_hostname = undef, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be |
||
Optional[Boolean] $dns_lookup_kdc = undef, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be |
||
Optional[Boolean] $dns_lookup_realm = undef, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be |
||
Optional[Boolean] $dns_fallback = undef, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be |
||
Optional[String] $realm_try_domains = undef, | ||
Array $extra_addresses = [], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be Note to self: the current join logic used for |
||
Optional[String] $udp_preference_limit = undef, | ||
Optional[Boolean] $verify_ap_req_nofail = undef, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be |
||
Optional[String] $ticket_lifetime = undef, | ||
Optional[String] $renew_lifetime = undef, | ||
Optional[Boolean] $noaddresses = undef, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be |
||
Optional[Boolean] $forwardable = undef, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be |
||
Optional[Boolean] $proxiable = undef, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be |
||
Optional[Boolean] $rdns = undef, | ||
flepoutre marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Optional[String] $pkinit_anchors = undef, | ||
Optional[String] $spake_preauth_groups = undef, | ||
Optional[String] $plugin_base_dir = undef, | ||
Optional[String] $include = undef, | ||
flepoutre marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Optional[String] $includedir = undef, | ||
flepoutre marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Optional[String] $module = undef, | ||
flepoutre marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Optional[String] $db_module_dir = undef, | ||
String $krb5_conf_path = '/etc/krb5.conf', | ||
String $krb5_conf_owner = 'root', | ||
String $krb5_conf_group = 'root', | ||
String $krb5_conf_mode = '0444', | ||
Boolean $alter_etc_services = false, | ||
Boolean $krb5_conf_warn = true, | ||
Hash $domain_realms = {}, | ||
Hash $capaths = {}, | ||
Hash $appdefaults = {}, | ||
Hash $realms = {}, | ||
Hash $dbmodules = {}, | ||
) { | ||
# SECTION: Parameter validation { | ||
# Boolean-type parameters are not type-validated at this time. | ||
|
@@ -305,21 +319,19 @@ | |
# END Parameter validation } | ||
|
||
# SECTION: Resource creation { | ||
anchor { 'mit_krb5::begin': } | ||
|
||
class { '::mit_krb5::install': } | ||
contain 'mit_krb5::install' | ||
|
||
if ($alter_etc_services == true) { | ||
class { '::mit_krb5::config::etc_services': | ||
require => Class['::mit_krb5::install'] | ||
class { 'mit_krb5::config::etc_services': | ||
require => Class['mit_krb5::install'], | ||
} | ||
} | ||
|
||
concat { $krb5_conf_path: | ||
owner => $krb5_conf_owner, | ||
group => $krb5_conf_group, | ||
mode => $krb5_conf_mode, | ||
warn => $krb5_conf_warn | ||
warn => $krb5_conf_warn, | ||
} | ||
concat::fragment { 'mit_krb5::header': | ||
target => $krb5_conf_path, | ||
|
@@ -339,13 +351,11 @@ | |
create_resources('mit_krb5::realm', $realms) | ||
create_resources('mit_krb5::dbmodules', $dbmodules) | ||
|
||
anchor { 'mit_krb5::end': } | ||
# END Resource creation } | ||
|
||
# SECTION: Resource ordering { | ||
Anchor['mit_krb5::begin'] | ||
-> Class['mit_krb5::install'] | ||
contain 'mit_krb5::install' | ||
Class['mit_krb5::install'] | ||
-> Concat[$krb5_conf_path] | ||
-> Anchor['mit_krb5::end'] | ||
# END Resource ordering } | ||
} |
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.
To ensure backward compatibility, I think that we should introduce a new data type
Mit_krb5::Bool_or_str
such as:Once introduced,
$forwadable
should be of typeOptional[Mit_krb5::Bool_or_str]