Skip to content

Commit

Permalink
Add support for Windows Server 2025 (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
jborean93 authored Nov 8, 2024
1 parent 29b3cfc commit 7bc3389
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 23 deletions.
4 changes: 4 additions & 0 deletions .azure-pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ stages:
test: 2022/psrp/https
- name: Server 2022 SSH Key
test: 2022/ssh/key
- name: Server 2025 PSRP HTTPS
test: 2025/psrp/https
- name: Server 2025 SSH Key
test: 2025/ssh/key
groups:
- 1
- stage: Summary
Expand Down
2 changes: 2 additions & 0 deletions changelogs/fragments/win-2025.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- Added support for Windows Server 2025
4 changes: 2 additions & 2 deletions plugins/modules/domain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ DOCUMENTATION:
level, but it can be higher.
- The default is automatically computed and set.
- Current known modes are C(Win2003), C(Win2008), C(Win2008R2),
C(Win2012), C(Win2012R2), or C(WinThreshold).
C(Win2012), C(Win2012R2), C(WinThreshold), or C(Win2025).
type: str
domain_netbios_name:
description:
Expand All @@ -55,7 +55,7 @@ DOCUMENTATION:
- The default forest functional level in Windows Server is typically the
same as the version you are running.
- Current known modes are C(Win2003), C(Win2008), C(Win2008R2),
C(Win2012), C(Win2012R2), or C(WinThreshold).
C(Win2012), C(Win2012R2), C(WinThreshold), or C(Win2025).
type: str
install_dns:
description:
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/domain_child.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ DOCUMENTATION:
functional level, but it can be higher.
- The default is automatically computed and set.
- Current known modes are C(Win2003), C(Win2008), C(Win2008R2),
C(Win2012), C(Win2012R2), or C(WinThreshold).
C(Win2012), C(Win2012R2), C(WinThreshold), or C(Win2025).
type: str
domain_type:
description:
Expand Down
22 changes: 2 additions & 20 deletions tests/integration/targets/domain/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,14 @@
failed_when:
- fail_long_netbios_name.msg != "The parameter 'domain_netbios_name' should not exceed 15 characters in length"

- name: get OS version
ansible.windows.win_powershell:
script: |
$Ansible.Changed = $false
$osVersion = [System.Environment]::OSVersion.Version
'{0}.{1}' -f $osVersion.Major, $osVersion.Minor
register: os_version

- set_fact:
known_modes:
'6.2': Win2003, Win2008, Win2008R2, Win2012, Default
'6.3': Win2008, Win2008R2, Win2012, Win2012R2, Default
default: Win2008, Win2008R2, Win2012, Win2012R2, WinThreshold, Default

- set_fact:
expected_modes: '{{ known_modes[os_version.output[0]] | default(known_modes["default"]) }}'

- name: fail when domain_mode is invalid
domain:
dns_domain_name: '{{ domain_realm }}'
safe_mode_password: '{{ domain_password }}'
domain_mode: fail
register: fail_domain_mode
failed_when:
- 'fail_domain_mode.msg != "The parameter ''domain_mode'' does not accept ''fail'', please use one of: " ~ expected_modes'
- 'not fail_domain_mode.msg is match("The parameter ''domain_mode'' does not accept ''fail'', please use one of: .*")'

- name: fail when forest_mode is invalid
domain:
Expand All @@ -63,4 +45,4 @@
forest_mode: fail
register: fail_forest_mode
failed_when:
- 'fail_forest_mode.msg != "The parameter ''forest_mode'' does not accept ''fail'', please use one of: " ~ expected_modes'
- 'not fail_forest_mode.msg is match("The parameter ''forest_mode'' does not accept ''fail'', please use one of: .*")'
13 changes: 13 additions & 0 deletions tests/integration/targets/inventory_ldap/roles/test/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,17 @@
- inventory_out._meta.hostvars == {}
- '"Cannot use simple auth with encryption" in inventory_out_raw.stderr'

- name: Get OS version number
ansible.windows.win_powershell:
script: '[Environment]::OSVersion.Version.ToString()'
register: os_version
changed_when: False

# Server 2025+ disables Simple LDAP bind not over TLS
- name: Check if we should skip Simple LDAP Bind
ansible.builtin.set_fact:
run_simple_bind: '{{ os_version.output[0] is version("10.0.26100", "<") }}'

- import_tasks: invoke.yml
vars:
scenario: Simple auth over LDAP with no encryption
Expand All @@ -202,10 +213,12 @@
password: '{{ ldap_pass }}'
auth_protocol: simple
encrypt: false
when: run_simple_bind

- name: assert Simple auth over LDAP with no encryption
assert:
that: *default-assertion
when: run_simple_bind

- import_tasks: invoke.yml
vars:
Expand Down

0 comments on commit 7bc3389

Please sign in to comment.