Skip to content

Commit 53f2887

Browse files
committed
Replace documentation with type alias
Keep the top-of-line documentation simple, but supply additional hints as to how to configure ldap via a type alias (struct) as well as a yardoc link to the relevant API documentation.
1 parent ecc4646 commit 53f2887

File tree

5 files changed

+41
-37
lines changed

5 files changed

+41
-37
lines changed

documentation/install.md

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Example params.json Bolt parameters file (shown: Extra Large with DR):
107107
}
108108
```
109109

110-
Example params.json Bolt parameters file including LDAP configuration (shown: Standard):
110+
Example params.json Bolt parameters file (shown: Standard):
111111

112112
```json
113113
{
@@ -116,36 +116,10 @@ Example params.json Bolt parameters file including LDAP configuration (shown: St
116116
"console_password": "puppetlabs",
117117
"dns_alt_names": [ "puppet", "puppet.lab1.puppet.vm" ],
118118
"version": "2021.5.0",
119-
120-
"ldap_config": {
121-
"help_link": "https://help.example.com",
122-
"ssl": true,
123-
"group_name_attr": "name",
124-
"password": "skippy",
125-
"group_rdn": null,
126-
"connect_timeout": 15,
127-
"user_display_name_attr": "cn",
128-
"disable_ldap_matching_rule_in_chain": false,
129-
"ssl_hostname_validation": true,
130-
"hostname": "ldap.example.com",
131-
"base_dn": "dc=example,dc=com",
132-
"user_lookup_attr": "uid",
133-
"port": 636,
134-
"login": "cn=ldapuser,ou=service,ou=users,dc=example,dc=com",
135-
"group_lookup_attr": "cn",
136-
"group_member_attr": "uniqueMember",
137-
"ssl_wildcard_validation": false,
138-
"user_email_attr": "mail",
139-
"user_rdn": "ou=users",
140-
"group_object_class": "groupOfUniqueNames",
141-
"display_name": "Acme Corp Ldap server",
142-
"search_nested_groups": true,
143-
"start_tls": false
144-
}
145119
}
146120
```
147121

148-
Review the [peadm::install plan](../plans/install.pp) to learn about more advanced installation options. It is possible to supply an ssh private key and git clone URL for a control-repo as part of installation, for example.
122+
Review the [peadm::install plan](../plans/install.pp) to learn about more advanced installation options. For example, it is possible to: supply an ssh private key and git clone URL for a control-repo as part of installation; supply the LDAP configuration data for PE; and similar complete automation tie-ins.
149123

150124
## Offline usage
151125

plans/install.pp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
# specified, PEAdm will attempt to download PE installation media from its
1717
# standard public source. When specified, PEAdm will download directly from the
1818
# URL given.
19+
# @param ldap_config
20+
# If specified, configures PE RBAC DS with the supplied configuration hash.
21+
# The parameter should be set to a valid set of connection settings as
22+
# documented for the PE RBAC /ds endpoint. See:
23+
# https://puppet.com/docs/pe/latest/rbac_api_v1_directory.html#put_ds-request_format
1924
#
2025
plan peadm::install (
2126
# Standard
@@ -38,7 +43,7 @@
3843
Optional[String] $internal_compiler_a_pool_address = undef,
3944
Optional[String] $internal_compiler_b_pool_address = undef,
4045
Optional[Hash] $pe_conf_data = { },
41-
Optional[Hash] $ldap_config = undef,
46+
Optional[Peadm::Ldap_config] $ldap_config = undef,
4247

4348
# Code Manager
4449
Optional[String] $r10k_remote = undef,

plans/subplans/configure.pp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
Optional[Peadm::SingleTargetSpec] $replica_postgresql_host = undef,
3131

3232
# Common Configuration
33-
String $compiler_pool_address = $primary_host.peadm::certname(),
34-
Optional[String] $internal_compiler_a_pool_address = undef,
35-
Optional[String] $internal_compiler_b_pool_address = undef,
36-
Optional[String] $token_file = undef,
37-
Optional[String] $deploy_environment = undef,
38-
Optional[Hash] $ldap_config = undef,
33+
String $compiler_pool_address = $primary_host.peadm::certname(),
34+
Optional[String] $internal_compiler_a_pool_address = undef,
35+
Optional[String] $internal_compiler_b_pool_address = undef,
36+
Optional[String] $token_file = undef,
37+
Optional[String] $deploy_environment = undef,
38+
Optional[Peadm::Ldap_config] $ldap_config = undef,
3939

4040
# Other
4141
String $stagingdir = '/tmp',

tasks/pe_ldap_config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"description": "Set the ldap config in the PE console",
33
"parameters": {
44
"ldap_config": {
5-
"type": "Hash",
5+
"type": "Peadm::Ldap_config",
66
"description": "The hash of options for ldap."
77
},
88
"pe_main": {
@@ -14,4 +14,4 @@
1414
"implementations": [
1515
{"name": "pe_ldap_config.rb"}
1616
]
17-
}
17+
}

types/ldap_config.pp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
type Peadm::Ldap_config = Struct[{
2+
base_dn => String,
3+
connect_timeout => Integer,
4+
disable_ldap_matching_rule_in_chain => Boolean,
5+
display_name => String,
6+
group_lookup_attr => String,
7+
group_member_attr => String,
8+
group_name_attr => String,
9+
group_object_class => String,
10+
Optional[group_rdn] => Optional[String],
11+
Optional[help_link] => Optional[String],
12+
hostname => String,
13+
Optional[login] => Optional[String],
14+
Optional[password] => Optional[String],
15+
port => Integer,
16+
search_nested_groups => Boolean,
17+
ssl => Boolean,
18+
ssl_hostname_validation => Boolean,
19+
ssl_wildcard_validation => Boolean,
20+
start_tls => Boolean,
21+
user_display_name_attr => String,
22+
user_email_attr => String,
23+
user_lookup_attr => String,
24+
Optional[user_rdn] => Optional[String],
25+
}]

0 commit comments

Comments
 (0)