Skip to content

Commit

Permalink
Add support for Windows Server 2025
Browse files Browse the repository at this point in the history
  • Loading branch information
jborean93 committed Nov 8, 2024
1 parent eeca23e commit e2574be
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 15 deletions.
12 changes: 12 additions & 0 deletions .azure-pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ stages:
test: 2022/psrp/https
- name: 2022 SSH Key
test: 2022/ssh/key
- name: 2025 PSRP HTTPS
test: 2025/psrp/https
- name: 2025 SSH Key
test: 2025/ssh/key
- stage: Windows_2
displayName: Windows 2
dependsOn: []
Expand All @@ -146,6 +150,10 @@ stages:
test: 2022/psrp/https
- name: 2022 SSH Key
test: 2022/ssh/key
- name: 2025 PSRP HTTPS
test: 2025/psrp/https
- name: 2025 SSH Key
test: 2025/ssh/key
- stage: Windows_3
displayName: Windows 3
dependsOn: []
Expand All @@ -165,6 +173,10 @@ stages:
test: 2022/psrp/https
- name: 2022 SSH Key
test: 2022/ssh/key
- name: 2025 PSRP HTTPS
test: 2025/psrp/https
- name: 2025 SSH Key
test: 2025/ssh/key
- stage: Summary
condition: succeededOrFailed()
dependsOn:
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
2 changes: 1 addition & 1 deletion tests/integration/targets/win_acl/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
test_acl_path: '{{ win_output_dir }}\win_acl .ÅÑŚÌβŁÈ [$!@^&test(;)]'
test_acl_path: '{{ remote_tmp_dir }}\win_acl .ÅÑŚÌβŁÈ [$!@^&test(;)]'
test_acl_network_path: \\localhost\{{ test_acl_path[0:1] }}$\{{ test_acl_path[3:] }}
# Use HKU as that path is not automatically loaded in the PSProvider making our test more complex
test_acl_reg_path: HKU:\.DEFAULT\Ansible Test .ÅÑŚÌβŁÈ [$!@^&test(;)]
2 changes: 2 additions & 0 deletions tests/integration/targets/win_acl/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dependencies:
- setup_remote_tmp_dir
12 changes: 2 additions & 10 deletions tests/integration/targets/win_acl/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
---
- name: ensure we start with a clean dir
- name: setup test directory
win_file:
path: '{{ test_acl_path }}'
state: '{{ item }}'
with_items:
- absent
- directory
state: directory

- name: ensure we start with a clean reg path
win_regedit:
Expand Down Expand Up @@ -54,11 +51,6 @@
include_tasks: tests.yml

always:
- name: cleanup testing dir
win_file:
path: '{{ test_acl_path }}'
state: absent

- name: cleanup testing reg path
win_regedit:
path: '{{ test_acl_reg_path }}'
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/targets/win_reboot/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dependencies:
- setup_remote_tmp_dir
4 changes: 2 additions & 2 deletions tests/integration/targets/win_reboot/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: make sure win output dir exists
win_file:
path: "{{win_output_dir}}"
path: "{{remote_tmp_dir}}"
state: directory

- name: reboot with defaults
Expand All @@ -21,7 +21,7 @@
# test a reboot that reboots again during the test_command phase
- name: create test file
win_file:
path: '{{win_output_dir}}\win_reboot_test'
path: '{{remote_tmp_dir}}\win_reboot_test'
state: touch

- name: reboot with secondary reboot stage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
if (Test-Path -LiteralPath '{{win_output_dir}}\win_reboot_test') {
if (Test-Path -LiteralPath '{{remote_tmp_dir}}\win_reboot_test') {
New-ItemProperty -LiteralPath 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager' `
-Name PendingFileRenameOperations `
-Value @("\??\{{win_output_dir}}\win_reboot_test`0") `
-Value @("\??\{{remote_tmp_dir}}\win_reboot_test`0") `
-PropertyType MultiString
Restart-Computer -Force
exit 1
Expand Down

0 comments on commit e2574be

Please sign in to comment.