Update Windows host requirements (#76582)

pull/76595/head
Jordan Borean 3 years ago committed by GitHub
parent 5db1d11c19
commit 7dd22b8b4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -84,13 +84,11 @@ created Windows VM:
The OS that is created is based on the image set. The following The OS that is created is based on the image set. The following
images can be used: images can be used:
- `jborean93/WindowsServer2008-x86 <https://app.vagrantup.com/jborean93/boxes/WindowsServer2008-x86>`_
- `jborean93/WindowsServer2008-x64 <https://app.vagrantup.com/jborean93/boxes/WindowsServer2008-x64>`_
- `jborean93/WindowsServer2008R2 <https://app.vagrantup.com/jborean93/boxes/WindowsServer2008R2>`_
- `jborean93/WindowsServer2012 <https://app.vagrantup.com/jborean93/boxes/WindowsServer2012>`_ - `jborean93/WindowsServer2012 <https://app.vagrantup.com/jborean93/boxes/WindowsServer2012>`_
- `jborean93/WindowsServer2012R2 <https://app.vagrantup.com/jborean93/boxes/WindowsServer2012R2>`_ - `jborean93/WindowsServer2012R2 <https://app.vagrantup.com/jborean93/boxes/WindowsServer2012R2>`_
- `jborean93/WindowsServer2016 <https://app.vagrantup.com/jborean93/boxes/WindowsServer2016>`_ - `jborean93/WindowsServer2016 <https://app.vagrantup.com/jborean93/boxes/WindowsServer2016>`_
- `jborean93/WindowsServer2019 <https://app.vagrantup.com/jborean93/boxes/WindowsServer2019>`_ - `jborean93/WindowsServer2019 <https://app.vagrantup.com/jborean93/boxes/WindowsServer2019>`_
- `jborean93/WindowsServer2022 <https://app.vagrantup.com/jborean93/boxes/WindowsServer2022>`_
When the host is online, it can accessible by RDP on ``127.0.0.1:3389`` but the 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 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 the default ``inventory.yml`` file, WinRM over HTTPS for ``SERVER2012R2`` is
forwarded over port ``29804`` as it's the fourth entry in ``domain_children``. 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 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 - 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 - 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 - 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 - 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 - Favor native Powershell cmdlets over executable calls if possible
- Use the full cmdlet name instead of aliases, for example ``Remove-Item`` over ``rm`` - Use the full cmdlet name instead of aliases, for example ``Remove-Item`` over ``rm``

@ -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: 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. - ``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: Aliases can be used to skip Python major versions using one of the following:

@ -116,8 +116,8 @@ Windows Tests
============= =============
These tests exercise the ``winrm`` connection plugin and Windows modules. You'll 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 need to define an inventory with a remote Windows Server to use for testing,
for testing, and enable PowerShell Remoting to continue. and enable PowerShell Remoting to continue.
Running these tests may result in changes to your Windows host, so don't run Running these tests may result in changes to your Windows host, so don't run
them against a production/critical Windows environment. them against a production/critical Windows environment.

@ -17,8 +17,7 @@ More details on DSC can be viewed at `DSC Overview <https://docs.microsoft.com/e
Host Requirements Host Requirements
````````````````` `````````````````
To use the ``win_dsc`` module, a Windows host must have PowerShell v5.0 or To use the ``win_dsc`` module, a Windows host must have PowerShell v5.0 or
newer installed. All supported hosts, except for Windows Server 2008 (non R2) can be newer installed. All supported hosts can be upgraded to PowerShell v5.
upgraded to PowerShell v5.
Once the PowerShell requirements have been met, using DSC is as simple as Once the PowerShell requirements have been met, using DSC is as simple as
creating a task with the ``win_dsc`` module. creating a task with the ``win_dsc`` module.

@ -14,8 +14,8 @@ Windows host must meet these requirements:
* Ansible can generally manage Windows versions under current * Ansible can generally manage Windows versions under current
and extended support from Microsoft. Ansible can manage desktop OSs including and extended support from Microsoft. Ansible can manage desktop OSs including
Windows 7, 8.1, and 10, and server OSs including Windows Server 2008, Windows 8.1, and 10, and server OSs including Windows Server 2012, 2012 R2,
2008 R2, 2012, 2012 R2, 2016, and 2019. 2016, 2019, and 2022.
* Ansible requires PowerShell 3.0 or newer and at least .NET 4.0 to be * Ansible requires PowerShell 3.0 or newer and at least .NET 4.0 to be
installed on the Windows host. installed on the Windows host.

Loading…
Cancel
Save