From 7dd22b8b4ba913263258e8225e13c8336006c04f Mon Sep 17 00:00:00 2001 From: Jordan Borean Date: Tue, 21 Dec 2021 04:43:01 +1000 Subject: [PATCH] Update Windows host requirements (#76582) --- .../dev_guide/developing_modules_general_windows.rst | 10 ++-------- .../dev_guide/testing/sanity/integration-aliases.rst | 2 +- docs/docsite/rst/dev_guide/testing_integration.rst | 4 ++-- docs/docsite/rst/user_guide/windows_dsc.rst | 3 +-- docs/docsite/rst/user_guide/windows_setup.rst | 4 ++-- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/docs/docsite/rst/dev_guide/developing_modules_general_windows.rst b/docs/docsite/rst/dev_guide/developing_modules_general_windows.rst index 30e5220b037..4bc0f66f436 100644 --- a/docs/docsite/rst/dev_guide/developing_modules_general_windows.rst +++ b/docs/docsite/rst/dev_guide/developing_modules_general_windows.rst @@ -84,13 +84,11 @@ created Windows VM: The OS that is created is based on the image set. The following images can be used: -- `jborean93/WindowsServer2008-x86 `_ -- `jborean93/WindowsServer2008-x64 `_ -- `jborean93/WindowsServer2008R2 `_ - `jborean93/WindowsServer2012 `_ - `jborean93/WindowsServer2012R2 `_ - `jborean93/WindowsServer2016 `_ - `jborean93/WindowsServer2019 `_ +- `jborean93/WindowsServer2022 `_ When the host is online, it can accessible by RDP on ``127.0.0.1:3389`` but the port may differ depending if there was a conflict. To get rid of the host, run @@ -157,10 +155,6 @@ controller started with ``00`` and is incremented from there. For example, in the default ``inventory.yml`` file, WinRM over HTTPS for ``SERVER2012R2`` is forwarded over port ``29804`` as it's the fourth entry in ``domain_children``. -.. note:: While an SSH server is available on all Windows hosts but Server - 2008 (non R2), it is not a support connection for Ansible managing Windows - hosts and should not be used with Ansible. - Windows new module development ============================== @@ -177,7 +171,7 @@ When creating a new module there are a few things to keep in mind: - Look for common functions in ``./lib/ansible/module_utils/powershell/`` and use the code there instead of duplicating work. These can be imported by adding the line ``#Requires -Module *`` where * is the filename to import, and will be automatically included with the module code sent to the Windows target when run via Ansible - As well as PowerShell module utils, C# module utils are stored in ``./lib/ansible/module_utils/csharp/`` and are automatically imported in a module execution if the line ``#AnsibleRequires -CSharpUtil *`` is present - C# and PowerShell module utils achieve the same goal but C# allows a developer to implement low level tasks, such as calling the Win32 API, and can be faster in some cases -- Ensure the code runs under Powershell v3 and higher on Windows Server 2008 and higher; if higher minimum Powershell or OS versions are required, ensure the documentation reflects this clearly +- Ensure the code runs under Powershell v3 and higher on Windows Server 2012 and higher; if higher minimum Powershell or OS versions are required, ensure the documentation reflects this clearly - Ansible runs modules under strictmode version 2.0. Be sure to test with that enabled by putting ``Set-StrictMode -Version 2.0`` at the top of your dev script - Favor native Powershell cmdlets over executable calls if possible - Use the full cmdlet name instead of aliases, for example ``Remove-Item`` over ``rm`` diff --git a/docs/docsite/rst/dev_guide/testing/sanity/integration-aliases.rst b/docs/docsite/rst/dev_guide/testing/sanity/integration-aliases.rst index 9e143b3f109..39a03126a84 100644 --- a/docs/docsite/rst/dev_guide/testing/sanity/integration-aliases.rst +++ b/docs/docsite/rst/dev_guide/testing/sanity/integration-aliases.rst @@ -74,7 +74,7 @@ Platform versions, as specified using the ``--remote`` option with ``/`` removed Windows versions, as specified using the ``--windows`` option can also be skipped: -- ``skip/windows/2008`` - Skip tests on Windows Server 2008. +- ``skip/windows/2012`` - Skip tests on Windows Server 2012. - ``skip/windows/2012-R2`` - Skip tests on Windows Server 2012 R2. Aliases can be used to skip Python major versions using one of the following: diff --git a/docs/docsite/rst/dev_guide/testing_integration.rst b/docs/docsite/rst/dev_guide/testing_integration.rst index 6597428cd74..055d8bc54c3 100644 --- a/docs/docsite/rst/dev_guide/testing_integration.rst +++ b/docs/docsite/rst/dev_guide/testing_integration.rst @@ -116,8 +116,8 @@ Windows Tests ============= These tests exercise the ``winrm`` connection plugin and Windows modules. You'll -need to define an inventory with a remote Windows 2008 or 2012 Server to use -for testing, and enable PowerShell Remoting to continue. +need to define an inventory with a remote Windows Server to use for testing, +and enable PowerShell Remoting to continue. Running these tests may result in changes to your Windows host, so don't run them against a production/critical Windows environment. diff --git a/docs/docsite/rst/user_guide/windows_dsc.rst b/docs/docsite/rst/user_guide/windows_dsc.rst index b4199cd5505..0dd53dea21c 100644 --- a/docs/docsite/rst/user_guide/windows_dsc.rst +++ b/docs/docsite/rst/user_guide/windows_dsc.rst @@ -17,8 +17,7 @@ More details on DSC can be viewed at `DSC Overview