Skip to content

Commit ec17aec

Browse files
authored
Merge pull request #696 from rawmind0/adtls
Added new argument rancher2_auth_config_activedirectory.start_tls
2 parents b4fdcea + 0e853c3 commit ec17aec

5 files changed

Lines changed: 20 additions & 6 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
FEATURES:
44

55
* **New Argument:** `rancher2_auth_config_keycloak.entity_id` - (Optional/Computed) KeyCloak Client ID field (string)
6+
* **New Argument:** `rancher2_auth_config_activedirectory.start_tls` - (Optional/Computed) Enable start TLS connection (bool)
67
* **New Argument:** `rancher2_node_pool.drain_before_delete` - (Optional) Drain nodes before delete (bool)
78

89
ENHANCEMENTS:

docs/resources/auth_config_activedirectory.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,15 @@ The following arguments are supported:
4949
* `group_search_filter` - (Optional/Computed) Group search filter (string)
5050
* `nested_group_membership_enabled` - (Optional/Computed) Nested group membership enable. Default `false` (bool)
5151
* `port` - (Optional) ActiveDirectory port. Default `389` (int)
52+
* `start_tls` - (Optional/Computed) Enable start TLS connection (bool)
53+
* `tls` - (Optional/Computed) Enable TLS connection (bool)
5254
* `user_disabled_bit_mask` - (Optional) User disabled bit mask. Default `2` (int)
5355
* `user_enabled_attribute` - (Optional/Computed) User enable attribute (string)
5456
* `user_login_attribute` - (Optional/Computed) User login attribute. Default `sAMAccountName` (string)
5557
* `user_name_attribute` - (Optional/Computed) User name attribute. Default `name` (string)
5658
* `user_object_class` - (Optional/Computed) User object class. Default `person` (string)
5759
* `user_search_attribute` - (Optional/Computed) User search attribute. Default `sAMAccountName|sn|givenName` (string)
5860
* `user_search_filter` - (Optional/Computed) User search filter (string)
59-
* `tls` - (Optional/Computed) Enable TLS connection (bool)
6061
* `annotations` - (Optional/Computed) Annotations of the resource (map)
6162
* `labels` - (Optional/Computed) Labels of the resource (map)
6263

rancher2/schema_auth_config_activedirectory.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,16 @@ func authConfigActiveDirectoryFields() map[string]*schema.Schema {
105105
Optional: true,
106106
Default: 389,
107107
},
108+
"start_tls": {
109+
Type: schema.TypeBool,
110+
Optional: true,
111+
Computed: true,
112+
},
113+
"tls": {
114+
Type: schema.TypeBool,
115+
Optional: true,
116+
Computed: true,
117+
},
108118
"user_disabled_bit_mask": {
109119
Type: schema.TypeInt,
110120
Optional: true,
@@ -140,11 +150,6 @@ func authConfigActiveDirectoryFields() map[string]*schema.Schema {
140150
Optional: true,
141151
Computed: true,
142152
},
143-
"tls": {
144-
Type: schema.TypeBool,
145-
Optional: true,
146-
Computed: true,
147-
},
148153
}
149154

150155
for k, v := range authConfigFields() {

rancher2/structure_auth_config_activedirectory.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ func flattenAuthConfigActiveDirectory(d *schema.ResourceData, in *managementClie
4949
d.Set("group_search_filter", in.GroupSearchFilter)
5050
d.Set("nested_group_membership_enabled", *in.NestedGroupMembershipEnabled)
5151
d.Set("port", int(in.Port))
52+
d.Set("start_tls", in.StartTLS)
5253
d.Set("tls", in.TLS)
5354
d.Set("user_disabled_bit_mask", int(in.UserDisabledBitMask))
5455
d.Set("user_enabled_attribute", in.UserEnabledAttribute)
@@ -164,6 +165,10 @@ func expandAuthConfigActiveDirectory(in *schema.ResourceData) (*managementClient
164165
obj.Port = int64(v)
165166
}
166167

168+
if v, ok := in.Get("start_tls").(bool); ok {
169+
obj.StartTLS = v
170+
}
171+
167172
if v, ok := in.Get("tls").(bool); ok {
168173
obj.TLS = v
169174
}

rancher2/structure_auth_config_activedirectory_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func init() {
3636
GroupSearchFilter: "group_search_filter",
3737
NestedGroupMembershipEnabled: newTrue(),
3838
Port: 389,
39+
StartTLS: true,
3940
TLS: true,
4041
UserDisabledBitMask: 0,
4142
UserEnabledAttribute: "user_enabled_attribute",
@@ -67,6 +68,7 @@ func init() {
6768
"group_search_filter": "group_search_filter",
6869
"nested_group_membership_enabled": true,
6970
"port": 389,
71+
"start_tls": true,
7072
"tls": true,
7173
"user_disabled_bit_mask": 0,
7274
"user_enabled_attribute": "user_enabled_attribute",

0 commit comments

Comments
 (0)