From 95a117090880906b757ba0643cd277b499e34048 Mon Sep 17 00:00:00 2001 From: Dag Wieers Date: Tue, 17 Jul 2018 23:29:05 +0200 Subject: [PATCH] Windows: Add "special" parameter types to docs (#42853) * Windows: Add special parameter types Adding explicit parameter types now exposes this information in the module documentation, and proves really helpful. We only do this for non-string types as strings, mostly because strings are implicit. PS We also make copyright statements consistent and use #Requires for explicit library imports * Type "string" must be type "str" * A few more Copyright corrections * More fixes * Don't add file encoding to Powershell files * Don't add missing interfacetypes parameter Otherwise CI demands an incorrect version_added * Small fix --- lib/ansible/modules/windows/_win_msi.ps1 | 22 +++---------- lib/ansible/modules/windows/_win_msi.py | 3 ++ lib/ansible/modules/windows/async_status.ps1 | 19 ++--------- lib/ansible/modules/windows/setup.ps1 | 2 +- lib/ansible/modules/windows/slurp.ps1 | 19 ++--------- lib/ansible/modules/windows/win_acl.ps1 | 7 ++-- .../modules/windows/win_acl_inheritance.ps1 | 22 +++---------- .../modules/windows/win_acl_inheritance.py | 1 + .../windows/win_audit_policy_system.ps1 | 1 + .../windows/win_audit_policy_system.py | 3 +- lib/ansible/modules/windows/win_audit_rule.py | 4 +++ .../modules/windows/win_certificate_store.ps1 | 1 - .../modules/windows/win_certificate_store.py | 1 + lib/ansible/modules/windows/win_chocolatey.py | 1 + lib/ansible/modules/windows/win_command.ps1 | 3 +- lib/ansible/modules/windows/win_command.py | 3 ++ lib/ansible/modules/windows/win_copy.ps1 | 1 - lib/ansible/modules/windows/win_copy.py | 2 ++ lib/ansible/modules/windows/win_defrag.ps1 | 3 +- lib/ansible/modules/windows/win_defrag.py | 2 ++ .../modules/windows/win_disk_facts.ps1 | 1 + .../modules/windows/win_disk_image.ps1 | 23 +++---------- .../modules/windows/win_dns_client.ps1 | 19 ++--------- lib/ansible/modules/windows/win_domain.ps1 | 33 ++++++------------- lib/ansible/modules/windows/win_domain.py | 2 ++ .../modules/windows/win_domain_computer.ps1 | 2 +- .../modules/windows/win_domain_controller.ps1 | 27 ++++++++------- .../modules/windows/win_domain_controller.py | 2 ++ .../modules/windows/win_domain_group.ps1 | 5 ++- .../modules/windows/win_domain_membership.ps1 | 21 ++---------- .../modules/windows/win_domain_user.ps1 | 1 - .../modules/windows/win_domain_user.py | 1 + .../modules/windows/win_dotnet_ngen.ps1 | 5 ++- lib/ansible/modules/windows/win_dsc.ps1 | 5 ++- lib/ansible/modules/windows/win_eventlog.ps1 | 21 ++---------- lib/ansible/modules/windows/win_eventlog.py | 5 +++ .../modules/windows/win_eventlog_entry.ps1 | 2 +- .../modules/windows/win_eventlog_entry.py | 4 ++- lib/ansible/modules/windows/win_feature.ps1 | 1 - lib/ansible/modules/windows/win_feature.py | 6 ++-- lib/ansible/modules/windows/win_file.ps1 | 1 - lib/ansible/modules/windows/win_file.py | 1 + .../modules/windows/win_file_version.ps1 | 20 ++--------- .../modules/windows/win_file_version.py | 1 + lib/ansible/modules/windows/win_find.ps1 | 3 +- lib/ansible/modules/windows/win_firewall.ps1 | 20 ++--------- lib/ansible/modules/windows/win_firewall.py | 1 + .../modules/windows/win_firewall_rule.ps1 | 8 ++--- .../modules/windows/win_firewall_rule.py | 1 + lib/ansible/modules/windows/win_get_url.ps1 | 6 ++-- lib/ansible/modules/windows/win_get_url.py | 3 ++ lib/ansible/modules/windows/win_group.ps1 | 22 +++---------- .../modules/windows/win_group_membership.ps1 | 2 +- .../modules/windows/win_group_membership.py | 1 + lib/ansible/modules/windows/win_hostname.ps1 | 1 + lib/ansible/modules/windows/win_hotfix.ps1 | 3 +- lib/ansible/modules/windows/win_hotfix.py | 1 + .../windows/win_iis_virtualdirectory.ps1 | 22 ++----------- .../windows/win_iis_webapplication.ps1 | 21 ++---------- .../modules/windows/win_iis_website.ps1 | 21 ++---------- lib/ansible/modules/windows/win_lineinfile.py | 1 + .../modules/windows/win_mapped_drive.ps1 | 3 +- .../modules/windows/win_mapped_drive.py | 1 + lib/ansible/modules/windows/win_msg.ps1 | 22 +++---------- lib/ansible/modules/windows/win_msg.py | 1 + lib/ansible/modules/windows/win_nssm.ps1 | 28 ++++------------ lib/ansible/modules/windows/win_owner.ps1 | 3 +- lib/ansible/modules/windows/win_owner.py | 1 + lib/ansible/modules/windows/win_package.ps1 | 5 ++- lib/ansible/modules/windows/win_package.py | 2 ++ lib/ansible/modules/windows/win_pagefile.ps1 | 8 ++--- lib/ansible/modules/windows/win_pagefile.py | 2 ++ lib/ansible/modules/windows/win_path.ps1 | 19 ++--------- lib/ansible/modules/windows/win_pester.ps1 | 10 +++--- lib/ansible/modules/windows/win_ping.ps1 | 19 ++--------- .../modules/windows/win_power_plan.ps1 | 2 +- .../modules/windows/win_product_facts.ps1 | 1 - lib/ansible/modules/windows/win_psexec.py | 4 +++ lib/ansible/modules/windows/win_psmodule.ps1 | 32 +++++------------- .../modules/windows/win_rabbitmq_plugin.ps1 | 6 ++-- lib/ansible/modules/windows/win_reboot.py | 5 +++ lib/ansible/modules/windows/win_reg_stat.ps1 | 19 ++--------- lib/ansible/modules/windows/win_regedit.ps1 | 6 ++-- lib/ansible/modules/windows/win_regedit.py | 4 ++- lib/ansible/modules/windows/win_region.ps1 | 19 ++--------- lib/ansible/modules/windows/win_regmerge.ps1 | 22 +++---------- lib/ansible/modules/windows/win_regmerge.py | 1 + lib/ansible/modules/windows/win_robocopy.ps1 | 9 +++-- lib/ansible/modules/windows/win_robocopy.py | 2 ++ lib/ansible/modules/windows/win_route.ps1 | 24 +++----------- lib/ansible/modules/windows/win_route.py | 1 + lib/ansible/modules/windows/win_say.ps1 | 22 +++---------- lib/ansible/modules/windows/win_say.py | 4 +++ .../modules/windows/win_scheduled_task.ps1 | 7 ++-- .../modules/windows/win_scheduled_task.py | 8 +++++ .../windows/win_scheduled_task_stat.ps1 | 2 +- .../modules/windows/win_security_policy.ps1 | 22 +++---------- lib/ansible/modules/windows/win_service.ps1 | 3 +- lib/ansible/modules/windows/win_service.py | 1 + lib/ansible/modules/windows/win_share.ps1 | 3 +- lib/ansible/modules/windows/win_share.py | 1 + lib/ansible/modules/windows/win_shell.ps1 | 3 +- lib/ansible/modules/windows/win_shell.py | 4 +++ lib/ansible/modules/windows/win_shortcut.ps1 | 10 +++--- lib/ansible/modules/windows/win_shortcut.py | 3 ++ lib/ansible/modules/windows/win_stat.ps1 | 3 +- lib/ansible/modules/windows/win_stat.py | 1 + lib/ansible/modules/windows/win_tempfile.ps1 | 7 ++-- lib/ansible/modules/windows/win_tempfile.py | 3 +- lib/ansible/modules/windows/win_timezone.ps1 | 22 +++---------- lib/ansible/modules/windows/win_toast.ps1 | 5 ++- lib/ansible/modules/windows/win_toast.py | 1 + lib/ansible/modules/windows/win_unzip.ps1 | 22 +++---------- lib/ansible/modules/windows/win_unzip.py | 3 ++ lib/ansible/modules/windows/win_updates.ps1 | 5 ++- lib/ansible/modules/windows/win_updates.py | 4 +++ lib/ansible/modules/windows/win_uri.py | 7 ++++ lib/ansible/modules/windows/win_user.ps1 | 22 +++---------- .../modules/windows/win_user_right.ps1 | 3 +- lib/ansible/modules/windows/win_user_right.py | 1 + lib/ansible/modules/windows/win_wait_for.ps1 | 5 ++- lib/ansible/modules/windows/win_wait_for.py | 7 ++++ lib/ansible/modules/windows/win_wakeonlan.ps1 | 1 - lib/ansible/modules/windows/win_wakeonlan.py | 1 + lib/ansible/modules/windows/win_webpicmd.ps1 | 24 +++----------- lib/ansible/modules/windows/win_whoami.ps1 | 3 +- test/sanity/pslint/ignore.txt | 1 - 127 files changed, 327 insertions(+), 664 deletions(-) diff --git a/lib/ansible/modules/windows/_win_msi.ps1 b/lib/ansible/modules/windows/_win_msi.ps1 index e13c6aacf1..784d674469 100644 --- a/lib/ansible/modules/windows/_win_msi.ps1 +++ b/lib/ansible/modules/windows/_win_msi.ps1 @@ -1,23 +1,9 @@ #!powershell -# (c) 2014, Matt Martz , and others -# -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# WANT_JSON -# POWERSHELL_COMMON +# Copyright: (c) 2014, Matt Martz , and others +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +#Requires -Module Ansible.ModuleUtils.Legacy $params = Parse-Args $args -supports_check_mode $true $check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false diff --git a/lib/ansible/modules/windows/_win_msi.py b/lib/ansible/modules/windows/_win_msi.py index d73a9b9f89..1d25940524 100644 --- a/lib/ansible/modules/windows/_win_msi.py +++ b/lib/ansible/modules/windows/_win_msi.py @@ -28,6 +28,7 @@ options: description: - File system path to the MSI file to install. required: yes + type: path extra_args: description: - Additional arguments to pass to the msiexec.exe command. @@ -40,10 +41,12 @@ options: description: - Path to a file created by installing the MSI to prevent from attempting to reinstall the package on every run. + type: path removes: description: - Path to a file removed by uninstalling the MSI to prevent from attempting to re-uninstall the package on every run. + type: path version_added: '2.4' wait: description: diff --git a/lib/ansible/modules/windows/async_status.ps1 b/lib/ansible/modules/windows/async_status.ps1 index 611a587823..10eb8a91ee 100644 --- a/lib/ansible/modules/windows/async_status.ps1 +++ b/lib/ansible/modules/windows/async_status.ps1 @@ -1,21 +1,8 @@ #!powershell -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# WANT_JSON -# POWERSHELL_COMMON +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +#Requires -Module Ansible.ModuleUtils.Legacy $results = @{changed=$false} diff --git a/lib/ansible/modules/windows/setup.ps1 b/lib/ansible/modules/windows/setup.ps1 index 36e70b0bd2..22b94fc000 100644 --- a/lib/ansible/modules/windows/setup.ps1 +++ b/lib/ansible/modules/windows/setup.ps1 @@ -1,6 +1,6 @@ #!powershell -# Copyright (c) 2018 Ansible Project +# Copyright: (c) 2018, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/lib/ansible/modules/windows/slurp.ps1 b/lib/ansible/modules/windows/slurp.ps1 index 0c8b85e1db..a8722ade00 100644 --- a/lib/ansible/modules/windows/slurp.ps1 +++ b/lib/ansible/modules/windows/slurp.ps1 @@ -1,21 +1,8 @@ #!powershell -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# WANT_JSON -# POWERSHELL_COMMON +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +#Requires -Module Ansible.ModuleUtils.Legacy $params = Parse-Args $args -supports_check_mode $true; $src = Get-AnsibleParam -obj $params -name "src" -type "path" -aliases "path" -failifempty $true; diff --git a/lib/ansible/modules/windows/win_acl.ps1 b/lib/ansible/modules/windows/win_acl.ps1 index 1077559fe5..da26fbf1df 100644 --- a/lib/ansible/modules/windows/win_acl.ps1 +++ b/lib/ansible/modules/windows/win_acl.ps1 @@ -1,7 +1,8 @@ #!powershell -# Copyright 2015, Phil Schwartz -# Copyright 2015, Trond Hindenes -# Copyright 2015, Hans-Joachim Kliemeck + +# Copyright: (c) 2015, Phil Schwartz +# Copyright: (c) 2015, Trond Hindenes +# Copyright: (c) 2015, Hans-Joachim Kliemeck # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/lib/ansible/modules/windows/win_acl_inheritance.ps1 b/lib/ansible/modules/windows/win_acl_inheritance.ps1 index cfc8b3bc0b..981eb0489e 100644 --- a/lib/ansible/modules/windows/win_acl_inheritance.ps1 +++ b/lib/ansible/modules/windows/win_acl_inheritance.ps1 @@ -1,23 +1,9 @@ #!powershell -# This file is part of Ansible -# -# Copyright 2015, Hans-Joachim Kliemeck -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# WANT_JSON -# POWERSHELL_COMMON +# Copyright: (c) 2015, Hans-Joachim Kliemeck +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +#Requires -Module Ansible.ModuleUtils.Legacy $params = Parse-Args $args -supports_check_mode $true $check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -default $false diff --git a/lib/ansible/modules/windows/win_acl_inheritance.py b/lib/ansible/modules/windows/win_acl_inheritance.py index 323f893913..fabaea019e 100644 --- a/lib/ansible/modules/windows/win_acl_inheritance.py +++ b/lib/ansible/modules/windows/win_acl_inheritance.py @@ -23,6 +23,7 @@ options: description: - Path to be used for changing inheritance required: yes + type: path state: description: - Specify whether to enable I(present) or disable I(absent) ACL inheritance diff --git a/lib/ansible/modules/windows/win_audit_policy_system.ps1 b/lib/ansible/modules/windows/win_audit_policy_system.ps1 index e50a6243d6..e58986f142 100644 --- a/lib/ansible/modules/windows/win_audit_policy_system.ps1 +++ b/lib/ansible/modules/windows/win_audit_policy_system.ps1 @@ -1,4 +1,5 @@ #!powershell + # Copyright: (c) 2017, Noah Sparks # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) diff --git a/lib/ansible/modules/windows/win_audit_policy_system.py b/lib/ansible/modules/windows/win_audit_policy_system.py index 1c4fb5068a..bf148e1298 100644 --- a/lib/ansible/modules/windows/win_audit_policy_system.py +++ b/lib/ansible/modules/windows/win_audit_policy_system.py @@ -34,8 +34,9 @@ options: description: - The type of event you would like to audit for. - Accepts a list. See examples. - choices: [ failure, none, success ] required: yes + type: list + choices: [ failure, none, success ] ''' EXAMPLES = r''' diff --git a/lib/ansible/modules/windows/win_audit_rule.py b/lib/ansible/modules/windows/win_audit_rule.py index 2c7dfa02a1..8aee221235 100644 --- a/lib/ansible/modules/windows/win_audit_rule.py +++ b/lib/ansible/modules/windows/win_audit_rule.py @@ -28,6 +28,7 @@ options: - Registry paths should be in Powershell format, beginning with an abbreviation for the root such as, 'hklm:\software'. required: yes + type: path aliases: [ dest, destination ] user: description: @@ -41,12 +42,14 @@ options: - If I(path) is a registry key, rights can be any right under MSDN RegistryRights U(https://msdn.microsoft.com/en-us/library/system.security.accesscontrol.registryrights.aspx). required: yes + type: list inheritance_flags: description: - Defines what objects inside of a folder or registry key will inherit the settings. - If you are setting a rule on a file, this value has to be changed to C(none). - For more information on the choices see MSDN PropagationFlags enumeration at U(https://msdn.microsoft.com/en-us/library/system.security.accesscontrol.inheritanceflags.aspx). + type: list default: "ContainerInherit,ObjectInherit" choices: [ ContainerInherit, ObjectInherit ] propagation_flags: @@ -62,6 +65,7 @@ options: - Defines whether to log on failure, success, or both. - To log both define as comma seperated list "Success, Failure". required: yes + type: list choices: [ Failure, Success ] state: description: diff --git a/lib/ansible/modules/windows/win_certificate_store.ps1 b/lib/ansible/modules/windows/win_certificate_store.ps1 index 5fb2c05ac6..31d2706823 100644 --- a/lib/ansible/modules/windows/win_certificate_store.ps1 +++ b/lib/ansible/modules/windows/win_certificate_store.ps1 @@ -1,5 +1,4 @@ #!powershell -# This file is part of Ansible # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) diff --git a/lib/ansible/modules/windows/win_certificate_store.py b/lib/ansible/modules/windows/win_certificate_store.py index f762df0f3d..2b839b3821 100644 --- a/lib/ansible/modules/windows/win_certificate_store.py +++ b/lib/ansible/modules/windows/win_certificate_store.py @@ -40,6 +40,7 @@ options: - This is required when I(state) is C(present) or C(exported). - When I(state) is C(absent) and I(thumbprint) is not specified, the thumbprint is derived from the certificate at this path. + type: path thumbprint: description: - The thumbprint as a hex string to either export or remove. diff --git a/lib/ansible/modules/windows/win_chocolatey.py b/lib/ansible/modules/windows/win_chocolatey.py index 86023a1d08..a17ac2a03d 100644 --- a/lib/ansible/modules/windows/win_chocolatey.py +++ b/lib/ansible/modules/windows/win_chocolatey.py @@ -80,6 +80,7 @@ options: timeout: description: - The time to allow chocolatey to finish before timing out. + type: int default: 2700 version_added: '2.3' aliases: [ execution_timeout ] diff --git a/lib/ansible/modules/windows/win_command.ps1 b/lib/ansible/modules/windows/win_command.ps1 index 5d88374f55..d021db3ac2 100644 --- a/lib/ansible/modules/windows/win_command.ps1 +++ b/lib/ansible/modules/windows/win_command.ps1 @@ -1,7 +1,6 @@ #!powershell -# This file is part of Ansible -# Copyright (c) 2017 Ansible Project +# Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/lib/ansible/modules/windows/win_command.py b/lib/ansible/modules/windows/win_command.py index c5cf317d66..cbac9b0f26 100644 --- a/lib/ansible/modules/windows/win_command.py +++ b/lib/ansible/modules/windows/win_command.py @@ -29,12 +29,15 @@ options: creates: description: - A path or path filter pattern; when the referenced path exists on the target host, the task will be skipped. + type: path removes: description: - A path or path filter pattern; when the referenced path B(does not) exist on the target host, the task will be skipped. + type: path chdir: description: - Set the specified path as the current working directory before executing a command. + type: path stdin: description: - Set the stdin of the command directly to the specified value. diff --git a/lib/ansible/modules/windows/win_copy.ps1 b/lib/ansible/modules/windows/win_copy.ps1 index 01718ea1b9..e3ac14a689 100644 --- a/lib/ansible/modules/windows/win_copy.ps1 +++ b/lib/ansible/modules/windows/win_copy.ps1 @@ -1,5 +1,4 @@ #!powershell -# This file is part of Ansible # Copyright: (c) 2015, Jon Hawkesworth (@jhawkesworth) # Copyright: (c) 2017, Ansible Project diff --git a/lib/ansible/modules/windows/win_copy.py b/lib/ansible/modules/windows/win_copy.py index e79fccf281..c94669c90d 100644 --- a/lib/ansible/modules/windows/win_copy.py +++ b/lib/ansible/modules/windows/win_copy.py @@ -42,6 +42,7 @@ options: - If C(src) and C(dest) are files and if the parent directory of C(dest) doesn't exist, then the task will fail. required: yes + type: path force: description: - If set to C(yes), the file will only be transferred if the content @@ -79,6 +80,7 @@ options: - If path is a file and dest ends with "\", the file is copied to the folder with the same filename. required: yes + type: path notes: - For non-Windows targets, use the M(copy) module instead. - Currently win_copy does not support copying symbolic links from both local to diff --git a/lib/ansible/modules/windows/win_defrag.ps1 b/lib/ansible/modules/windows/win_defrag.ps1 index 70df9c88df..18ccae7cbb 100644 --- a/lib/ansible/modules/windows/win_defrag.ps1 +++ b/lib/ansible/modules/windows/win_defrag.ps1 @@ -1,5 +1,4 @@ #!powershell -# -*- coding: utf-8 -*- # Copyright: (c) 2017, Dag Wieers (@dagwieers) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) @@ -16,7 +15,7 @@ $check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "b $include_volumes = Get-AnsibleParam -obj $params -name "include_volumes" -type "list" $exclude_volumes = Get-AnsibleParam -obj $params -name "exclude_volumes" -type "list" $freespace_consolidation = Get-AnsibleParam -obj $params -name "freespace_consolidation" -type "bool" -default $false -$priority = Get-AnsibleParam -obj $params -name "priority" -type "string" -default "low" -validateset "low","normal" +$priority = Get-AnsibleParam -obj $params -name "priority" -type "str" -default "low" -validateset "low","normal" $parallel = Get-AnsibleParam -obj $params -name "parallel" -type "bool" -default $false $result = @{ diff --git a/lib/ansible/modules/windows/win_defrag.py b/lib/ansible/modules/windows/win_defrag.py index 7e9e3c5269..99e2356da7 100644 --- a/lib/ansible/modules/windows/win_defrag.py +++ b/lib/ansible/modules/windows/win_defrag.py @@ -21,9 +21,11 @@ options: description: - A list of drive letters or mount point paths of the volumes to be defragmented. - If this parameter is omitted, all volumes (not excluded) will be fragmented. + type: list exclude_volumes: description: - A list of drive letters or mount point paths to exclude from defragmentation. + type: list freespace_consolidation: description: - Perform free space consolidation on the specified volumes. diff --git a/lib/ansible/modules/windows/win_disk_facts.ps1 b/lib/ansible/modules/windows/win_disk_facts.ps1 index e41f29de7c..a7ddafeb17 100644 --- a/lib/ansible/modules/windows/win_disk_facts.ps1 +++ b/lib/ansible/modules/windows/win_disk_facts.ps1 @@ -5,6 +5,7 @@ #Requires -Module Ansible.ModuleUtils.Legacy #AnsibleRequires -OSVersion 6.2 + $ErrorActionPreference = "Stop" Set-StrictMode -Version 2.0 diff --git a/lib/ansible/modules/windows/win_disk_image.ps1 b/lib/ansible/modules/windows/win_disk_image.ps1 index 76b04e572e..b03cd1cb6f 100644 --- a/lib/ansible/modules/windows/win_disk_image.ps1 +++ b/lib/ansible/modules/windows/win_disk_image.ps1 @@ -1,24 +1,9 @@ #!powershell -# (c) 2017, Red Hat, Inc. -# -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . +# Copyright: (c) 2017, Red Hat, Inc. +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# POWERSHELL_COMMON -# WANT_JSON +#Requires -Module Ansible.ModuleUtils.Legacy $ErrorActionPreference = "Stop" Set-StrictMode -Version 2 @@ -88,4 +73,4 @@ ElseIf($state -eq "absent") { } } -Exit-Json $result \ No newline at end of file +Exit-Json $result diff --git a/lib/ansible/modules/windows/win_dns_client.ps1 b/lib/ansible/modules/windows/win_dns_client.ps1 index 011aece0db..f5b21097c1 100644 --- a/lib/ansible/modules/windows/win_dns_client.ps1 +++ b/lib/ansible/modules/windows/win_dns_client.ps1 @@ -1,21 +1,8 @@ #!powershell -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# WANT_JSON -# POWERSHELL_COMMON +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +#Requires -Module Ansible.ModuleUtils.Legacy # FUTURE: check statically-set values via registry so we can determine difference between DHCP-source values and static values? (prevent spurious changed # notifications on DHCP-sourced values) diff --git a/lib/ansible/modules/windows/win_domain.ps1 b/lib/ansible/modules/windows/win_domain.ps1 index c3e6e8e3a9..c8105522cb 100644 --- a/lib/ansible/modules/windows/win_domain.ps1 +++ b/lib/ansible/modules/windows/win_domain.ps1 @@ -1,21 +1,8 @@ #!powershell -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# WANT_JSON -# POWERSHELL_COMMON +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +#Requires -Module Ansible.ModuleUtils.Legacy Set-StrictMode -Version 2 $ErrorActionPreference = "Stop" @@ -35,13 +22,13 @@ Function Ensure-Prereqs { } } -$parsed_args = Parse-Args $args -supports_check_mode $true -$check_mode = Get-AnsibleParam $parsed_args "_ansible_check_mode" -default $false -$dns_domain_name = Get-AnsibleParam $parsed_args "dns_domain_name" -failifempty $true -$domain_netbios_name = Get-AnsibleParam $parsed_args "domain_netbios_name" -$safe_mode_admin_password = Get-AnsibleParam $parsed_args "safe_mode_password" -failifempty $true -$database_path = Get-AnsibleParam $parsed_args "database_path" -type "path" -$sysvol_path = Get-AnsibleParam $parsed_args "sysvol_path" -type "path" +$params = Parse-Args $args -supports_check_mode $true +$check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -default $false +$dns_domain_name = Get-AnsibleParam -obj $params -name "dns_domain_name" -failifempty $true +$domain_netbios_name = Get-AnsibleParam -obj $params -name "domain_netbios_name" +$safe_mode_admin_password = Get-AnsibleParam -obj $params -name "safe_mode_password" -failifempty $true +$database_path = Get-AnsibleParam -obj $params -name "database_path" -type "path" +$sysvol_path = Get-AnsibleParam -obj $params -name "sysvol_path" -type "path" $forest = $null diff --git a/lib/ansible/modules/windows/win_domain.py b/lib/ansible/modules/windows/win_domain.py index 9de77461a8..d79712bde4 100644 --- a/lib/ansible/modules/windows/win_domain.py +++ b/lib/ansible/modules/windows/win_domain.py @@ -35,12 +35,14 @@ options: - The path to a directory on a fixed disk of the Windows host where the domain database will be created. - If not set then the default path is C(%SYSTEMROOT%\NTDS). + type: path version_added: '2.5' sysvol_path: description: - The path to a directory on a fixed disk of the Windows host where the Sysvol file will be created. - If not set then the default path is C(%SYSTEMROOT%\SYSVOL). + type: path version_added: '2.5' author: - Matt Davis (@nitzmahone) diff --git a/lib/ansible/modules/windows/win_domain_computer.ps1 b/lib/ansible/modules/windows/win_domain_computer.ps1 index d7413bfc45..14e944c044 100644 --- a/lib/ansible/modules/windows/win_domain_computer.ps1 +++ b/lib/ansible/modules/windows/win_domain_computer.ps1 @@ -1,5 +1,5 @@ #!powershell -# + # Copyright: (c) 2017, AMTEGA - Xunta de Galicia # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) diff --git a/lib/ansible/modules/windows/win_domain_controller.ps1 b/lib/ansible/modules/windows/win_domain_controller.ps1 index 280b154a2b..6e8cb9d175 100644 --- a/lib/ansible/modules/windows/win_domain_controller.ps1 +++ b/lib/ansible/modules/windows/win_domain_controller.ps1 @@ -1,5 +1,4 @@ #!powershell -# This file is part of Ansible # Copyright: (c) 2017, Red Hat, Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) @@ -95,21 +94,21 @@ $result = @{ reboot_required = $false } -$param = Parse-Args -arguments $args -supports_check_mode $true +$params = Parse-Args -arguments $args -supports_check_mode $true -$dns_domain_name = Get-AnsibleParam $param "dns_domain_name" -$safe_mode_password= Get-AnsibleParam $param "safe_mode_password" -$domain_admin_user = Get-AnsibleParam $param "domain_admin_user" -failifempty $result -$domain_admin_password= Get-AnsibleParam $param "domain_admin_password" -failifempty $result -$local_admin_password= Get-AnsibleParam $param "local_admin_password" -$database_path = Get-AnsibleParam $param "database_path" -type "path" -$sysvol_path = Get-AnsibleParam $param "sysvol_path" -type "path" -$read_only = Get-AnsibleParam $param "read_only" -type "bool" -default $false -$site_name = Get-AnsibleParam $param "site_name" -type "str" -failifempty $read_only +$dns_domain_name = Get-AnsibleParam -obj $params -name "dns_domain_name" +$safe_mode_password= Get-AnsibleParam -obj $params -name "safe_mode_password" +$domain_admin_user = Get-AnsibleParam -obj $params -name "domain_admin_user" -failifempty $result +$domain_admin_password= Get-AnsibleParam -obj $params -name "domain_admin_password" -failifempty $result +$local_admin_password= Get-AnsibleParam -obj $params -name "local_admin_password" +$database_path = Get-AnsibleParam -obj $params -name "database_path" -type "path" +$sysvol_path = Get-AnsibleParam -obj $params -name "sysvol_path" -type "path" +$read_only = Get-AnsibleParam -obj $params -name "read_only" -type "bool" -default $false +$site_name = Get-AnsibleParam -obj $params -name "site_name" -type "str" -failifempty $read_only -$state = Get-AnsibleParam $param "state" -validateset ("domain_controller", "member_server") -failifempty $result -$log_path = Get-AnsibleParam $param "log_path" -$_ansible_check_mode = Get-AnsibleParam $param "_ansible_check_mode" -default $false +$state = Get-AnsibleParam -obj $params -name "state" -validateset ("domain_controller", "member_server") -failifempty $result +$log_path = Get-AnsibleParam -obj $params -name "log_path" +$_ansible_check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -default $false $global:log_path = $log_path diff --git a/lib/ansible/modules/windows/win_domain_controller.py b/lib/ansible/modules/windows/win_domain_controller.py index c89bb377d3..6948a01c31 100644 --- a/lib/ansible/modules/windows/win_domain_controller.py +++ b/lib/ansible/modules/windows/win_domain_controller.py @@ -58,12 +58,14 @@ options: - The path to a directory on a fixed disk of the Windows host where the domain database will be created.. - If not set then the default path is C(%SYSTEMROOT%\NTDS). + type: path version_added: '2.5' sysvol_path: description: - The path to a directory on a fixed disk of the Windows host where the Sysvol folder will be created. - If not set then the default path is C(%SYSTEMROOT%\SYSVOL). + type: path version_added: '2.5' author: - Matt Davis (@nitzmahone) diff --git a/lib/ansible/modules/windows/win_domain_group.ps1 b/lib/ansible/modules/windows/win_domain_group.ps1 index 713e5e9eca..80aee1ca18 100644 --- a/lib/ansible/modules/windows/win_domain_group.ps1 +++ b/lib/ansible/modules/windows/win_domain_group.ps1 @@ -1,7 +1,6 @@ #!powershell -# This file is part of Ansible -# (c) 2017, Jordan Borean , and others +# Copyright: (c) 2017, Jordan Borean , and others # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy @@ -10,7 +9,7 @@ $ErrorActionPreference = "Stop" $params = Parse-Args -arguments $args -supports_check_mode $true $check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false -$diff_mode = Get-AnsibleParam -obj $Params -name "_ansible_diff" -type "bool" -default $false +$diff_mode = Get-AnsibleParam -obj $params -name "_ansible_diff" -type "bool" -default $false $name = Get-AnsibleParam -obj $params -name "name" -type "str" -failifempty $true $display_name = Get-AnsibleParam -obj $params -name "display_name" -type "str" diff --git a/lib/ansible/modules/windows/win_domain_membership.ps1 b/lib/ansible/modules/windows/win_domain_membership.ps1 index 28daeb00a5..ee280bb801 100644 --- a/lib/ansible/modules/windows/win_domain_membership.ps1 +++ b/lib/ansible/modules/windows/win_domain_membership.ps1 @@ -1,24 +1,9 @@ #!powershell -# (c) 2017, Red Hat, Inc. -# -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . +# Copyright: (c) 2017, Red Hat, Inc. +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# WANT_JSON -# POWERSHELL_COMMON +#Requires -Module Ansible.ModuleUtils.Legacy Set-StrictMode -Version 2 diff --git a/lib/ansible/modules/windows/win_domain_user.ps1 b/lib/ansible/modules/windows/win_domain_user.ps1 index c259201639..1d1122af33 100644 --- a/lib/ansible/modules/windows/win_domain_user.ps1 +++ b/lib/ansible/modules/windows/win_domain_user.ps1 @@ -1,5 +1,4 @@ #!powershell -# This file is part of Ansible # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) diff --git a/lib/ansible/modules/windows/win_domain_user.py b/lib/ansible/modules/windows/win_domain_user.py index da8857d4d8..9576c7e42c 100644 --- a/lib/ansible/modules/windows/win_domain_user.py +++ b/lib/ansible/modules/windows/win_domain_user.py @@ -52,6 +52,7 @@ options: Principal Group, set C(groups=) and I(groups_action=replace). Note that users cannot be removed from their principal group (for example, "Domain Users"). + type: list groups_action: description: - If C(add), the user is added to each group in I(groups) where not diff --git a/lib/ansible/modules/windows/win_dotnet_ngen.ps1 b/lib/ansible/modules/windows/win_dotnet_ngen.ps1 index ce2dab5080..8dfca6b1ee 100644 --- a/lib/ansible/modules/windows/win_dotnet_ngen.ps1 +++ b/lib/ansible/modules/windows/win_dotnet_ngen.ps1 @@ -1,8 +1,7 @@ #!powershell -# This file is part of Ansible -# Copyright 2015, Peter Mounce -# Copyright (c) 2017 Ansible Project +# Copyright: (c) 2015, Peter Mounce +# Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/lib/ansible/modules/windows/win_dsc.ps1 b/lib/ansible/modules/windows/win_dsc.ps1 index 87e1904ba5..d80fe640a4 100644 --- a/lib/ansible/modules/windows/win_dsc.ps1 +++ b/lib/ansible/modules/windows/win_dsc.ps1 @@ -1,8 +1,7 @@ #!powershell -# This file is part of Ansible -# (c) 2015, Trond Hindenes , and others -# Copyright (c) 2017 Ansible Project +# Copyright: (c) 2015, Trond Hindenes , and others +# Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/lib/ansible/modules/windows/win_eventlog.ps1 b/lib/ansible/modules/windows/win_eventlog.ps1 index fc993e2fde..c4f695ce22 100644 --- a/lib/ansible/modules/windows/win_eventlog.ps1 +++ b/lib/ansible/modules/windows/win_eventlog.ps1 @@ -1,24 +1,9 @@ #!powershell -# (c) 2017, Andrew Saraceni -# -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . +# Copyright: (c) 2017, Andrew Saraceni +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# WANT_JSON -# POWERSHELL_COMMON +#Requires -Module Ansible.ModuleUtils.Legacy $ErrorActionPreference = "Stop" diff --git a/lib/ansible/modules/windows/win_eventlog.py b/lib/ansible/modules/windows/win_eventlog.py index 0dc963d19e..969a1b8ed0 100644 --- a/lib/ansible/modules/windows/win_eventlog.py +++ b/lib/ansible/modules/windows/win_eventlog.py @@ -38,15 +38,19 @@ options: - A list of one or more sources to ensure are present/absent in the log. - When C(category_file), C(message_file) and/or C(parameter_file) are specified, these values are applied across all sources. + type: list category_file: description: - For one or more sources specified, the path to a custom category resource file. + type: path message_file: description: - For one or more sources specified, the path to a custom event message resource file. + type: path parameter_file: description: - For one or more sources specified, the path to a custom parameter resource file. + type: path maximum_size: description: - The maximum size of the event log. @@ -66,6 +70,7 @@ options: description: - The minimum number of days event entries must remain in the log. - This option is only used when C(overflow_action) is C(OverwriteOlder). + type: int author: - Andrew Saraceni (@andrewsaraceni) ''' diff --git a/lib/ansible/modules/windows/win_eventlog_entry.ps1 b/lib/ansible/modules/windows/win_eventlog_entry.ps1 index 82bf55b736..ddc4d1e168 100644 --- a/lib/ansible/modules/windows/win_eventlog_entry.ps1 +++ b/lib/ansible/modules/windows/win_eventlog_entry.ps1 @@ -1,6 +1,6 @@ #!powershell -# (c) 2017, Andrew Saraceni +# Copyright: (c) 2017, Andrew Saraceni # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/lib/ansible/modules/windows/win_eventlog_entry.py b/lib/ansible/modules/windows/win_eventlog_entry.py index 962b0f4000..dcec05b69c 100644 --- a/lib/ansible/modules/windows/win_eventlog_entry.py +++ b/lib/ansible/modules/windows/win_eventlog_entry.py @@ -1,7 +1,7 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2017, Andrew Saraceni +# Copyright: (c) 2017, Andrew Saraceni # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', @@ -29,6 +29,7 @@ options: - The numeric event identifier for the entry. - Value must be between 0 and 65535. required: yes + type: int message: description: - The message for the given log entry. @@ -45,6 +46,7 @@ options: category: description: - A numeric task category associated with the category message file for the log source. + type: int raw_data: description: - Binary data associated with the log entry. diff --git a/lib/ansible/modules/windows/win_feature.ps1 b/lib/ansible/modules/windows/win_feature.ps1 index 5124ae6a86..15550f8c19 100644 --- a/lib/ansible/modules/windows/win_feature.ps1 +++ b/lib/ansible/modules/windows/win_feature.ps1 @@ -1,5 +1,4 @@ #!powershell -# This file is part of Ansible # Copyright: (c) 2014, Paul Durivage # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) diff --git a/lib/ansible/modules/windows/win_feature.py b/lib/ansible/modules/windows/win_feature.py index 01dcb30934..68c18ff57f 100644 --- a/lib/ansible/modules/windows/win_feature.py +++ b/lib/ansible/modules/windows/win_feature.py @@ -1,9 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# This file is part of Ansible - -# (c) 2014, Paul Durivage , Trond Hindenes and others +# Copyright: (c) 2014, Paul Durivage +# Copyright: (c) 2014, Trond Hindenes # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 @@ -27,6 +26,7 @@ options: description: - Names of roles or features to install as a single feature or a comma-separated list of features. required: yes + type: list state: description: - State of the features or roles on the system. diff --git a/lib/ansible/modules/windows/win_file.ps1 b/lib/ansible/modules/windows/win_file.ps1 index 318396e714..60cf3762e4 100644 --- a/lib/ansible/modules/windows/win_file.ps1 +++ b/lib/ansible/modules/windows/win_file.ps1 @@ -1,7 +1,6 @@ #!powershell # Copyright: (c) 2017, Ansible Project - # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/lib/ansible/modules/windows/win_file.py b/lib/ansible/modules/windows/win_file.py index 9e1cdb88fb..418a98f14c 100644 --- a/lib/ansible/modules/windows/win_file.py +++ b/lib/ansible/modules/windows/win_file.py @@ -28,6 +28,7 @@ options: description: - Path to the file being managed. required: yes + type: path aliases: [ dest, name ] state: description: diff --git a/lib/ansible/modules/windows/win_file_version.ps1 b/lib/ansible/modules/windows/win_file_version.ps1 index 747571f94c..634c186f55 100644 --- a/lib/ansible/modules/windows/win_file_version.ps1 +++ b/lib/ansible/modules/windows/win_file_version.ps1 @@ -1,23 +1,9 @@ #!powershell -#this file is part of Ansible -#Copyright © 2015 Sam Liu +# Copyright: (c) 2015, Sam Liu +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -#This program is free software: you can redistribute it and/or modify -#it under the terms of the GNU General Public License as published by -#the Free Software Foundation, either version 3 of the License, or -#(at your option) any later version. - -#This program is distributed in the hope that it will be useful, -#but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#GNU General Public License for more details. - -#You should have received a copy of the GNU General Public License -#along with this program. If not, see . - -# WANT_JSON -# POWERSHELL_COMMON +#Requires -Module Ansible.ModuleUtils.Legacy $params = Parse-Args $args -supports_check_mode $true diff --git a/lib/ansible/modules/windows/win_file_version.py b/lib/ansible/modules/windows/win_file_version.py index ef69d68a30..33574d63fd 100644 --- a/lib/ansible/modules/windows/win_file_version.py +++ b/lib/ansible/modules/windows/win_file_version.py @@ -23,6 +23,7 @@ options: - File to get version. - Always provide absolute path. required: yes + type: path author: - Sam Liu (@SamLiu79) ''' diff --git a/lib/ansible/modules/windows/win_find.ps1 b/lib/ansible/modules/windows/win_find.ps1 index 87c45fed95..fc8c1dc925 100644 --- a/lib/ansible/modules/windows/win_find.ps1 +++ b/lib/ansible/modules/windows/win_find.ps1 @@ -1,7 +1,6 @@ #!powershell -# This file is part of Ansible -# Copyright (c) 2016 Ansible Project +# Copyright: (c) 2016, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/lib/ansible/modules/windows/win_firewall.ps1 b/lib/ansible/modules/windows/win_firewall.ps1 index dbfca5b5f5..547de13f62 100644 --- a/lib/ansible/modules/windows/win_firewall.ps1 +++ b/lib/ansible/modules/windows/win_firewall.ps1 @@ -1,23 +1,9 @@ #!powershell -# This file is part of Ansible -# Copyright 2017, Michael Eaton -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . +# Copyright: (c) 2017, Michael Eaton +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# WANT_JSON -# POWERSHELL_COMMON +#Requires -Module Ansible.ModuleUtils.Legacy $ErrorActionPreference = "Stop" $firewall_profiles = @('Domain', 'Private', 'Public') diff --git a/lib/ansible/modules/windows/win_firewall.py b/lib/ansible/modules/windows/win_firewall.py index 2d440a0565..a352fa83ec 100644 --- a/lib/ansible/modules/windows/win_firewall.py +++ b/lib/ansible/modules/windows/win_firewall.py @@ -22,6 +22,7 @@ options: profiles: description: - Specify one or more profiles to change. + type: list choices: - Domain - Private diff --git a/lib/ansible/modules/windows/win_firewall_rule.ps1 b/lib/ansible/modules/windows/win_firewall_rule.ps1 index 0ef7bc1935..1f512de602 100644 --- a/lib/ansible/modules/windows/win_firewall_rule.ps1 +++ b/lib/ansible/modules/windows/win_firewall_rule.ps1 @@ -1,10 +1,10 @@ #!powershell -# Copyright (c) 2017 Artem Zinenko -# Copyright (c) 2014 Timothy Vandenbrande + +# Copyright: (c) 2014, Timothy Vandenbrande +# Copyright: (c) 2017, Artem Zinenko # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# WANT_JSON -# POWERSHELL_COMMON +#Requires -Module Ansible.ModuleUtils.Legacy function Parse-ProtocolType { param($protocol) diff --git a/lib/ansible/modules/windows/win_firewall_rule.py b/lib/ansible/modules/windows/win_firewall_rule.py index 180fd684f0..5c1e4691ca 100644 --- a/lib/ansible/modules/windows/win_firewall_rule.py +++ b/lib/ansible/modules/windows/win_firewall_rule.py @@ -75,6 +75,7 @@ options: profiles: description: - The profile this rule applies to. + type: list default: domain,private,public aliases: [ profile ] force: diff --git a/lib/ansible/modules/windows/win_get_url.ps1 b/lib/ansible/modules/windows/win_get_url.ps1 index 8cd1998adc..c105915974 100644 --- a/lib/ansible/modules/windows/win_get_url.ps1 +++ b/lib/ansible/modules/windows/win_get_url.ps1 @@ -1,7 +1,7 @@ #!powershell -# This file is part of Ansible. -# -# Copyright: (c) 2015, Paul Durivage , Tal Auslander + +# Copyright: (c) 2015, Paul Durivage +# Copyright: (c) 2015, Tal Auslander # Copyright: (c) 2017, Dag Wieers # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) diff --git a/lib/ansible/modules/windows/win_get_url.py b/lib/ansible/modules/windows/win_get_url.py index 630272b8b1..f493116e96 100644 --- a/lib/ansible/modules/windows/win_get_url.py +++ b/lib/ansible/modules/windows/win_get_url.py @@ -33,6 +33,7 @@ options: - The location to save the file at the URL. - Be sure to include a filename and extension as appropriate. required: yes + type: path force: description: - If C(yes), will always download the file. If C(no), will only @@ -47,6 +48,7 @@ options: headers: description: - Add custom HTTP headers to a request (as a dictionary). + type: dict version_added: '2.4' url_username: description: @@ -100,6 +102,7 @@ options: timeout: description: - Timeout in seconds for URL request. + type: int default: 10 version_added : '2.4' ''' diff --git a/lib/ansible/modules/windows/win_group.ps1 b/lib/ansible/modules/windows/win_group.ps1 index 24f20103de..68246f2feb 100644 --- a/lib/ansible/modules/windows/win_group.ps1 +++ b/lib/ansible/modules/windows/win_group.ps1 @@ -1,23 +1,9 @@ #!powershell -# This file is part of Ansible -# -# Copyright 2014, Chris Hoffman -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# WANT_JSON -# POWERSHELL_COMMON +# Copyright: (c) 2014, Chris Hoffman +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +#Requires -Module Ansible.ModuleUtils.Legacy $params = Parse-Args $args; $check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false diff --git a/lib/ansible/modules/windows/win_group_membership.ps1 b/lib/ansible/modules/windows/win_group_membership.ps1 index 44d5407c63..9093cfe15f 100644 --- a/lib/ansible/modules/windows/win_group_membership.ps1 +++ b/lib/ansible/modules/windows/win_group_membership.ps1 @@ -145,4 +145,4 @@ if ($final_members) { $result.members = @() } -Exit-Json -obj $result \ No newline at end of file +Exit-Json -obj $result diff --git a/lib/ansible/modules/windows/win_group_membership.py b/lib/ansible/modules/windows/win_group_membership.py index 1e92bbc159..d2d2079238 100644 --- a/lib/ansible/modules/windows/win_group_membership.py +++ b/lib/ansible/modules/windows/win_group_membership.py @@ -30,6 +30,7 @@ options: - Accepts all local, domain and service user types as username, favoring domain lookups when in a domain. required: yes + type: list state: description: - Desired state of the members in the group. diff --git a/lib/ansible/modules/windows/win_hostname.ps1 b/lib/ansible/modules/windows/win_hostname.ps1 index 0d9f3e9d85..ff447321e0 100644 --- a/lib/ansible/modules/windows/win_hostname.ps1 +++ b/lib/ansible/modules/windows/win_hostname.ps1 @@ -1,4 +1,5 @@ #!powershell + # Copyright: (c) 2018, Ripon Banik (@riponbanik) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) diff --git a/lib/ansible/modules/windows/win_hotfix.ps1 b/lib/ansible/modules/windows/win_hotfix.ps1 index 8abfd5f46c..482ec8c3bc 100644 --- a/lib/ansible/modules/windows/win_hotfix.ps1 +++ b/lib/ansible/modules/windows/win_hotfix.ps1 @@ -1,7 +1,6 @@ #!powershell -# This file is part of Ansible -# Copyright (c) 2017 Ansible Project +# Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/lib/ansible/modules/windows/win_hotfix.py b/lib/ansible/modules/windows/win_hotfix.py index 8d4700d55d..1459ff3979 100644 --- a/lib/ansible/modules/windows/win_hotfix.py +++ b/lib/ansible/modules/windows/win_hotfix.py @@ -46,6 +46,7 @@ options: description: - The path to the downloaded hotfix .msu file. - This MUST be set if C(state=present) and MUST be a .msu hotfix file. + type: path notes: - This must be run on a host that has the DISM powershell module installed and a Powershell version >= 4. diff --git a/lib/ansible/modules/windows/win_iis_virtualdirectory.ps1 b/lib/ansible/modules/windows/win_iis_virtualdirectory.ps1 index e8fd6b421f..dd27fe1adc 100644 --- a/lib/ansible/modules/windows/win_iis_virtualdirectory.ps1 +++ b/lib/ansible/modules/windows/win_iis_virtualdirectory.ps1 @@ -1,25 +1,9 @@ #!powershell -# -*- coding: utf-8 -*- -# (c) 2015, Henrik Wallström -# -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . +# Copyright: (c) 2015, Henrik Wallström +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# WANT_JSON -# POWERSHELL_COMMON +#Requires -Module Ansible.ModuleUtils.Legacy $params = Parse-Args $args; diff --git a/lib/ansible/modules/windows/win_iis_webapplication.ps1 b/lib/ansible/modules/windows/win_iis_webapplication.ps1 index fd781faaaa..f030a26702 100644 --- a/lib/ansible/modules/windows/win_iis_webapplication.ps1 +++ b/lib/ansible/modules/windows/win_iis_webapplication.ps1 @@ -1,24 +1,9 @@ #!powershell -# (c) 2015, Henrik Wallström -# -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . +# Copyright: (c) 2015, Henrik Wallström +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# WANT_JSON -# POWERSHELL_COMMON +#Requires -Module Ansible.ModuleUtils.Legacy $params = Parse-Args $args -supports_check_mode $true $check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false diff --git a/lib/ansible/modules/windows/win_iis_website.ps1 b/lib/ansible/modules/windows/win_iis_website.ps1 index 731ffca95b..9afc396e5e 100644 --- a/lib/ansible/modules/windows/win_iis_website.ps1 +++ b/lib/ansible/modules/windows/win_iis_website.ps1 @@ -1,24 +1,9 @@ #!powershell -# (c) 2015, Henrik Wallström -# -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . +# Copyright: (c) 2015, Henrik Wallström +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# WANT_JSON -# POWERSHELL_COMMON +#Requires -Module Ansible.ModuleUtils.Legacy $params = Parse-Args $args; diff --git a/lib/ansible/modules/windows/win_lineinfile.py b/lib/ansible/modules/windows/win_lineinfile.py index 4c639d010b..36df3e3255 100644 --- a/lib/ansible/modules/windows/win_lineinfile.py +++ b/lib/ansible/modules/windows/win_lineinfile.py @@ -24,6 +24,7 @@ options: - Note that the Windows path delimiter C(\) must be escaped as C(\\) when the line is double quoted. - Before 2.3 this option was only usable as I(dest), I(destfile) and I(name). required: yes + type: path aliases: [ dest, destfile, name ] regexp: description: diff --git a/lib/ansible/modules/windows/win_mapped_drive.ps1 b/lib/ansible/modules/windows/win_mapped_drive.ps1 index 4a3f4ae2dc..fbdcc135f8 100644 --- a/lib/ansible/modules/windows/win_mapped_drive.ps1 +++ b/lib/ansible/modules/windows/win_mapped_drive.ps1 @@ -1,7 +1,6 @@ #!powershell -# This file is part of Ansible -# Copyright (c) 2017 Ansible Project +# Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/lib/ansible/modules/windows/win_mapped_drive.py b/lib/ansible/modules/windows/win_mapped_drive.py index 1687852d2f..48c4f028fc 100644 --- a/lib/ansible/modules/windows/win_mapped_drive.py +++ b/lib/ansible/modules/windows/win_mapped_drive.py @@ -43,6 +43,7 @@ options: drive regardless of the target. - If C(state=absent) and the path is set, the module will throw an error if path does not match the target of the mapped drive. + type: path state: description: - If C(present) will ensure the mapped drive exists. diff --git a/lib/ansible/modules/windows/win_msg.ps1 b/lib/ansible/modules/windows/win_msg.ps1 index c3dd033afc..0746836d8f 100644 --- a/lib/ansible/modules/windows/win_msg.ps1 +++ b/lib/ansible/modules/windows/win_msg.ps1 @@ -1,24 +1,10 @@ #!powershell -# This file is part of Ansible -# -# Copyright 2016, Jon Hawkesworth (@jhawkesworth) -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# WANT_JSON -# POWERSHELL_COMMON +# Copyright: (c) 2016, Jon Hawkesworth (@jhawkesworth) +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +#Requires -Module Ansible.ModuleUtils.Legacy +# $stopwatch = [system.diagnostics.stopwatch]::startNew() $params = Parse-Args $args -supports_check_mode $true diff --git a/lib/ansible/modules/windows/win_msg.py b/lib/ansible/modules/windows/win_msg.py index 8cbe755ae8..ed9c9542e2 100644 --- a/lib/ansible/modules/windows/win_msg.py +++ b/lib/ansible/modules/windows/win_msg.py @@ -26,6 +26,7 @@ options: display_seconds: description: - How long to wait for receiver to acknowledge message, in seconds. + type: int default: 10 wait: description: diff --git a/lib/ansible/modules/windows/win_nssm.ps1 b/lib/ansible/modules/windows/win_nssm.ps1 index 56e57c37cf..c10b6ce2b2 100644 --- a/lib/ansible/modules/windows/win_nssm.ps1 +++ b/lib/ansible/modules/windows/win_nssm.ps1 @@ -1,28 +1,14 @@ #!powershell -# This file is part of Ansible -# -# Copyright 2015, George Frank -# Copyright 2015, Adam Keech -# Copyright 2015, Hans-Joachim Kliemeck -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . + +# Copyright: (c) 2015, George Frank +# Copyright: (c) 2015, Adam Keech +# Copyright: (c) 2015, Hans-Joachim Kliemeck +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +#Requires -Module Ansible.ModuleUtils.Legacy $ErrorActionPreference = "Stop" -# WANT_JSON -# POWERSHELL_COMMON - $params = Parse-Args $args $result = @{ diff --git a/lib/ansible/modules/windows/win_owner.ps1 b/lib/ansible/modules/windows/win_owner.ps1 index 6cd5b187f5..8fc5d4ca5c 100644 --- a/lib/ansible/modules/windows/win_owner.ps1 +++ b/lib/ansible/modules/windows/win_owner.ps1 @@ -1,5 +1,6 @@ #!powershell -# Copyright 2015, Hans-Joachim Kliemeck + +# Copyright: (c) 2015, Hans-Joachim Kliemeck # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/lib/ansible/modules/windows/win_owner.py b/lib/ansible/modules/windows/win_owner.py index 5a6b1a4283..5882779456 100644 --- a/lib/ansible/modules/windows/win_owner.py +++ b/lib/ansible/modules/windows/win_owner.py @@ -20,6 +20,7 @@ options: description: - Path to be used for changing owner required: yes + type: path user: description: - Name to be used for changing owner diff --git a/lib/ansible/modules/windows/win_package.ps1 b/lib/ansible/modules/windows/win_package.ps1 index 8b79499d87..50ca42f8f7 100644 --- a/lib/ansible/modules/windows/win_package.ps1 +++ b/lib/ansible/modules/windows/win_package.ps1 @@ -1,8 +1,7 @@ #!powershell -# This file is part of Ansible -# (c) 2014, Trond Hindenes , and others -# Copyright (c) 2017 Ansible Project +# Copyright: (c) 2014, Trond Hindenes , and others +# Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/lib/ansible/modules/windows/win_package.py b/lib/ansible/modules/windows/win_package.py index 1154f8b43c..f8e2f3460b 100644 --- a/lib/ansible/modules/windows/win_package.py +++ b/lib/ansible/modules/windows/win_package.py @@ -37,6 +37,7 @@ options: - Will check the existance of the path specified and use the result to determine whether the package is already installed. - You can use this in conjunction with C(product_id) and other C(creates_*). + type: path version_added: '2.4' creates_service: description: @@ -59,6 +60,7 @@ options: C(3010). - A return code of C(3010) usually means that a reboot is required, the C(reboot_required) return value is set if the return code is C(3010). + type: list default: [0, 3010] password: description: diff --git a/lib/ansible/modules/windows/win_pagefile.ps1 b/lib/ansible/modules/windows/win_pagefile.ps1 index 1d82404c7a..c0dcae1d4b 100644 --- a/lib/ansible/modules/windows/win_pagefile.ps1 +++ b/lib/ansible/modules/windows/win_pagefile.ps1 @@ -1,11 +1,9 @@ #!powershell -# This file is part of Ansible -# -# Copyright 2017, Liran Nisanov + +# Copyright: (c) 2017, Liran Nisanov # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# WANT_JSON -# POWERSHELL_COMMON +#Requires -Module Ansible.ModuleUtils.Legacy ######## diff --git a/lib/ansible/modules/windows/win_pagefile.py b/lib/ansible/modules/windows/win_pagefile.py index 08f064e14a..ed59ed775a 100644 --- a/lib/ansible/modules/windows/win_pagefile.py +++ b/lib/ansible/modules/windows/win_pagefile.py @@ -27,9 +27,11 @@ options: initial_size: description: - The initial size of the pagefile in megabytes. + type: int maximum_size: description: - The maximum size of the pagefile in megabytes. + type: int override: description: - Override the current pagefile on the drive. diff --git a/lib/ansible/modules/windows/win_path.ps1 b/lib/ansible/modules/windows/win_path.ps1 index 219f5a3486..04eb41a374 100644 --- a/lib/ansible/modules/windows/win_path.ps1 +++ b/lib/ansible/modules/windows/win_path.ps1 @@ -1,21 +1,8 @@ #!powershell -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# WANT_JSON -# POWERSHELL_COMMON +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +#Requires -Module Ansible.ModuleUtils.Legacy Set-StrictMode -Version 2 $ErrorActionPreference = "Stop" diff --git a/lib/ansible/modules/windows/win_pester.ps1 b/lib/ansible/modules/windows/win_pester.ps1 index 1fbb68892b..d46337a0f2 100644 --- a/lib/ansible/modules/windows/win_pester.ps1 +++ b/lib/ansible/modules/windows/win_pester.ps1 @@ -1,10 +1,8 @@ #!powershell -# This file is part of Ansible +# Copyright: (c) 2017, Erwan Quelin (@equelin) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# Author: Erwan Quelin (mail:erwan.quelin@gmail.com - GitHub: @equelin - Twitter: @erwanquelin) - #Requires -Module Ansible.ModuleUtils.Legacy $ErrorActionPreference = 'Stop' @@ -15,8 +13,8 @@ $diff_mode = Get-AnsibleParam -obj $params -name "_ansible_diff" -type "bool" -d # Modules parameters -$path = Get-AnsibleParam -obj $params -name "path" -type "string" -failifempty $true -$minimum_version = Get-AnsibleParam -obj $params -name "minimum_version" -type "string" -failifempty $false +$path = Get-AnsibleParam -obj $params -name "path" -type "str" -failifempty $true +$minimum_version = Get-AnsibleParam -obj $params -name "minimum_version" -type "str" -failifempty $false $result = @{ changed = $false @@ -102,4 +100,4 @@ If (Test-Path -LiteralPath $path -PathType Leaf) { $result.changed = $true -Exit-Json -obj $result \ No newline at end of file +Exit-Json -obj $result diff --git a/lib/ansible/modules/windows/win_ping.ps1 b/lib/ansible/modules/windows/win_ping.ps1 index 8a1c453980..898eed607e 100644 --- a/lib/ansible/modules/windows/win_ping.ps1 +++ b/lib/ansible/modules/windows/win_ping.ps1 @@ -1,21 +1,8 @@ #!powershell -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# WANT_JSON -# POWERSHELL_COMMON +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +#Requires -Module Ansible.ModuleUtils.Legacy $ErrorActionPreference = "Stop" diff --git a/lib/ansible/modules/windows/win_power_plan.ps1 b/lib/ansible/modules/windows/win_power_plan.ps1 index 6022b447b8..ad565a8fef 100644 --- a/lib/ansible/modules/windows/win_power_plan.ps1 +++ b/lib/ansible/modules/windows/win_power_plan.ps1 @@ -1,6 +1,6 @@ #!powershell -# Copyright (c) 2017 Ansible Project +# Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/lib/ansible/modules/windows/win_product_facts.ps1 b/lib/ansible/modules/windows/win_product_facts.ps1 index 7a0bc3f16f..78bc4db762 100644 --- a/lib/ansible/modules/windows/win_product_facts.ps1 +++ b/lib/ansible/modules/windows/win_product_facts.ps1 @@ -1,5 +1,4 @@ #!powershell -# -*- coding: utf-8 -*- # Copyright: (c) 2017, Dag Wieers (dagwieers) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) diff --git a/lib/ansible/modules/windows/win_psexec.py b/lib/ansible/modules/windows/win_psexec.py index bd3d183f99..6196e7809a 100644 --- a/lib/ansible/modules/windows/win_psexec.py +++ b/lib/ansible/modules/windows/win_psexec.py @@ -24,11 +24,13 @@ options: executable: description: - The location of the PsExec utility (in case it is not located in your PATH). + type: path default: psexec.exe hostnames: description: - The hostnames to run the command. - If not provided, the command is run locally. + type: list username: description: - The (remote) user to run the command as. @@ -40,6 +42,7 @@ options: chdir: description: - Run the command from this (remote) directory. + type: path nobanner: description: - Do not display the startup banner and copyright message. @@ -85,6 +88,7 @@ options: timeout: description: - The connection timeout in seconds + type: int wait: description: - Wait for the application to terminate. diff --git a/lib/ansible/modules/windows/win_psmodule.ps1 b/lib/ansible/modules/windows/win_psmodule.ps1 index 20efd38ab6..ac03580dfe 100644 --- a/lib/ansible/modules/windows/win_psmodule.ps1 +++ b/lib/ansible/modules/windows/win_psmodule.ps1 @@ -1,33 +1,19 @@ #!powershell -# This file is part of Ansible -# -# Copyright 2017, Daniele Lazzari -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# WANT_JSON -# POWERSHELL_COMMON +# Copyright: (c) 2017, Daniele Lazzari +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +#Requires -Module Ansible.ModuleUtils.Legacy # win_psmodule (Powershell modules Additions/Removal) $params = Parse-Args $args -supports_check_mode $true -$name = Get-AnsibleParam -obj $params "name" -type "str" -failifempty $true -$repo = Get-AnsibleParam -obj $params "repository" -type "str" -$url = Get-AnsibleParam -obj $params "url" -type "str" -$state = Get-AnsibleParam -obj $params "state" -type "str" -default "present" -validateset "present", "absent" -$allow_clobber = Get-AnsibleParam -obj $params "allow_clobber" -type "bool" -default $false +$name = Get-AnsibleParam -obj $params -name "name" -type "str" -failifempty $true +$repo = Get-AnsibleParam -obj $params -name "repository" -type "str" +$url = Get-AnsibleParam -obj $params -name "url" -type "str" +$state = Get-AnsibleParam -obj $params -name "state" -type "str" -default "present" -validateset "present", "absent" +$allow_clobber = Get-AnsibleParam -obj $params -name "allow_clobber" -type "bool" -default $false $check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -default $false $result = @{"changed" = $false diff --git a/lib/ansible/modules/windows/win_rabbitmq_plugin.ps1 b/lib/ansible/modules/windows/win_rabbitmq_plugin.ps1 index aae9a639d2..c8c2d58348 100644 --- a/lib/ansible/modules/windows/win_rabbitmq_plugin.ps1 +++ b/lib/ansible/modules/windows/win_rabbitmq_plugin.ps1 @@ -1,9 +1,9 @@ #!powershell -# Copyright (c) 2017 Ansible Project + +# Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# WANT_JSON -# POWERSHELL_COMMON +#Requires -Module Ansible.ModuleUtils.Legacy function Get-EnabledPlugins($rabbitmq_plugins_cmd) { diff --git a/lib/ansible/modules/windows/win_reboot.py b/lib/ansible/modules/windows/win_reboot.py index 64e6018dfb..dc0131f415 100644 --- a/lib/ansible/modules/windows/win_reboot.py +++ b/lib/ansible/modules/windows/win_reboot.py @@ -18,12 +18,14 @@ options: pre_reboot_delay: description: - Seconds for shutdown to wait before requesting reboot + type: int default: 2 aliases: [ pre_reboot_delay_sec ] post_reboot_delay: description: - Seconds to wait after the reboot was successful and the connection was re-established - This is useful if you want wait for something to settle despite your connection already working + type: int default: 0 version_added: '2.4' aliases: [ post_reboot_delay_sec ] @@ -32,17 +34,20 @@ options: - Maximum seconds to wait for shutdown to occur - Increase this timeout for very slow hardware, large update applications, etc - This option has been removed since Ansible 2.5 as the win_reboot behavior has changed + type: int default: 600 aliases: [ shutdown_timeout_sec ] reboot_timeout: description: - Maximum seconds to wait for machine to re-appear on the network and respond to a test command - This timeout is evaluated separately for both network appearance and test command success (so maximum clock time is actually twice this value) + type: int default: 600 aliases: [ reboot_timeout_sec ] connect_timeout: description: - Maximum seconds to wait for a single successful TCP connection to the WinRM endpoint before trying again + type: int default: 5 aliases: [ connect_timeout_sec ] test_command: diff --git a/lib/ansible/modules/windows/win_reg_stat.ps1 b/lib/ansible/modules/windows/win_reg_stat.ps1 index ae6a200146..5d517ac37d 100644 --- a/lib/ansible/modules/windows/win_reg_stat.ps1 +++ b/lib/ansible/modules/windows/win_reg_stat.ps1 @@ -1,21 +1,8 @@ #!powershell -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# WANT_JSON -# POWERSHELL_COMMON +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +#Requires -Module Ansible.ModuleUtils.Legacy $ErrorActionPreference = "Stop" diff --git a/lib/ansible/modules/windows/win_regedit.ps1 b/lib/ansible/modules/windows/win_regedit.ps1 index 20f4f1bc41..abeed87366 100644 --- a/lib/ansible/modules/windows/win_regedit.ps1 +++ b/lib/ansible/modules/windows/win_regedit.ps1 @@ -1,8 +1,8 @@ #!powershell -# This file is part of Ansible -# (c) 2015, Adam Keech , Josh Ludwig -# (c) 2017, Jordan Borean +# Copyright: (c) 2015, Adam Keech +# Copyright: (c) 2015, Josh Ludwig +# Copyright: (c) 2017, Jordan Borean # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/lib/ansible/modules/windows/win_regedit.py b/lib/ansible/modules/windows/win_regedit.py index 333f9703bd..43c6b79882 100644 --- a/lib/ansible/modules/windows/win_regedit.py +++ b/lib/ansible/modules/windows/win_regedit.py @@ -1,7 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright: (c) 2015, Adam Keech , Josh Ludwig +# Copyright: (c) 2015, Adam Keech +# Copyright: (c) 2015, Josh Ludwig # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 @@ -79,6 +80,7 @@ options: other hive saved as a file. - Using this function requires the user to have the C(SeRestorePrivilege) and C(SeBackupPrivilege) privileges enabled. + type: path version_added: '2.5' notes: - Check-mode C(-C/--check) and diff output C(-D/--diff) are supported, so that you can test every change against the active configuration before diff --git a/lib/ansible/modules/windows/win_region.ps1 b/lib/ansible/modules/windows/win_region.ps1 index e05adfe6da..df2059da5d 100644 --- a/lib/ansible/modules/windows/win_region.ps1 +++ b/lib/ansible/modules/windows/win_region.ps1 @@ -1,21 +1,8 @@ #!powershell -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# WANT_JSON -# POWERSHELL_COMMON +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +#Requires -Module Ansible.ModuleUtils.Legacy $params = Parse-Args -arguments $args -supports_check_mode $true $check_mode = Get-AnsibleParam -obj $params "_ansible_check_mode" -type 'bool' -default $false diff --git a/lib/ansible/modules/windows/win_regmerge.ps1 b/lib/ansible/modules/windows/win_regmerge.ps1 index 1c2380a4f4..e21b9ff4dc 100644 --- a/lib/ansible/modules/windows/win_regmerge.ps1 +++ b/lib/ansible/modules/windows/win_regmerge.ps1 @@ -1,23 +1,9 @@ #!powershell -# This file is part of Ansible -# -# Copyright 2015, Jon Hawkesworth (@jhawkesworth) -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# WANT_JSON -# POWERSHELL_COMMON +# Copyright: (c) 2015, Jon Hawkesworth (@jhawkesworth) +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +#Requires -Module Ansible.ModuleUtils.Legacy Function Convert-RegistryPath { Param ( diff --git a/lib/ansible/modules/windows/win_regmerge.py b/lib/ansible/modules/windows/win_regmerge.py index 9db2edfea9..eee718cada 100644 --- a/lib/ansible/modules/windows/win_regmerge.py +++ b/lib/ansible/modules/windows/win_regmerge.py @@ -29,6 +29,7 @@ options: description: - The full path including file name to the registry file on the remote machine to be merged required: yes + type: path compare_key: description: - The parent key to use when comparing the contents of the registry to the contents of the file. Needs to be in HKLM or HKCU part of registry. diff --git a/lib/ansible/modules/windows/win_robocopy.ps1 b/lib/ansible/modules/windows/win_robocopy.ps1 index 3e3c9861bf..859577d9b2 100644 --- a/lib/ansible/modules/windows/win_robocopy.ps1 +++ b/lib/ansible/modules/windows/win_robocopy.ps1 @@ -1,10 +1,9 @@ #!powershell -# -# Copyright 2015, Corwin Brown + +# Copyright: (c) 2015, Corwin Brown # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# WANT_JSON -# POWERSHELL_COMMON +#Requires -Module Ansible.ModuleUtils.Legacy $params = Parse-Args $args -supports_check_mode $true $check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false @@ -13,7 +12,7 @@ $src = Get-AnsibleParam -obj $params -name "src" -type "path" -failifempty $true $dest = Get-AnsibleParam -obj $params -name "dest" -type "path" -failifempty $true $purge = Get-AnsibleParam -obj $params -name "purge" -type "bool" -default $false $recurse = Get-AnsibleParam -obj $params -name "recurse" -type "bool" -default $false -$flags = Get-AnsibleParam -obj $params -name "flags" -type "string" +$flags = Get-AnsibleParam -obj $params -name "flags" -type "str" $result = @{ changed = $false diff --git a/lib/ansible/modules/windows/win_robocopy.py b/lib/ansible/modules/windows/win_robocopy.py index beb27fed83..3a06e98d93 100644 --- a/lib/ansible/modules/windows/win_robocopy.py +++ b/lib/ansible/modules/windows/win_robocopy.py @@ -25,10 +25,12 @@ options: description: - Source file/directory to sync. required: yes + type: path dest: description: - Destination file/directory to sync (Will receive contents of src). required: yes + type: path recurse: description: - Includes all subdirectories (Toggles the C(/e) flag to RoboCopy). diff --git a/lib/ansible/modules/windows/win_route.ps1 b/lib/ansible/modules/windows/win_route.ps1 index 44e38ed971..895d97d7f0 100644 --- a/lib/ansible/modules/windows/win_route.ps1 +++ b/lib/ansible/modules/windows/win_route.ps1 @@ -1,23 +1,9 @@ #!powershell -# This file is part of Ansible -# -# Copyright 2016, Daniele Lazzari -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# WANT_JSON -# POWERSHELL_COMMON +# Copyright: (c) 2016, Daniele Lazzari +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +#Requires -Module Ansible.ModuleUtils.Legacy # win_route (Add or remove a network static route) @@ -115,4 +101,4 @@ else { } -Exit-Json $result \ No newline at end of file +Exit-Json $result diff --git a/lib/ansible/modules/windows/win_route.py b/lib/ansible/modules/windows/win_route.py index c748bc77c2..54736a5270 100644 --- a/lib/ansible/modules/windows/win_route.py +++ b/lib/ansible/modules/windows/win_route.py @@ -30,6 +30,7 @@ options: metric: description: - Metric used by the static route. + type: int default: 1 state: description: diff --git a/lib/ansible/modules/windows/win_say.ps1 b/lib/ansible/modules/windows/win_say.ps1 index 6cb8a13418..0ac630393b 100644 --- a/lib/ansible/modules/windows/win_say.ps1 +++ b/lib/ansible/modules/windows/win_say.ps1 @@ -1,23 +1,9 @@ #!powershell -# This file is part of Ansible -# -# Copyright 2016, Jon Hawkesworth (@jhawkesworth) -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# WANT_JSON -# POWERSHELL_COMMON +# Copyright: (c) 2016, Jon Hawkesworth (@jhawkesworth) +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +#Requires -Module Ansible.ModuleUtils.Legacy $params = Parse-Args $args -supports_check_mode $true $check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false diff --git a/lib/ansible/modules/windows/win_say.py b/lib/ansible/modules/windows/win_say.py index 755a657f29..b6433c1940 100644 --- a/lib/ansible/modules/windows/win_say.py +++ b/lib/ansible/modules/windows/win_say.py @@ -30,6 +30,7 @@ options: - Full path to a windows format text file containing the text to be spokend. - Use either C(msg) or C(msg_file). - Optional so that you can use this module just to play sounds. + type: path voice: description: - Which voice to use. See notes for how to discover installed voices. @@ -41,15 +42,18 @@ options: - How fast or slow to speak the text. - Must be an integer value in the range -10 to 10. - -10 is slowest, 10 is fastest. + type: int default: 0 start_sound_path: description: - Full path to a C(.wav) file containing a sound to play before the text is spoken. - Useful on conference calls to alert other speakers that ansible has something to say. + type: path end_sound_path: description: - Full path to a C(.wav) file containing a sound to play after the text has been spoken. - Useful on conference calls to alert other speakers that ansible has finished speaking. + type: path author: - Jon Hawkesworth (@jhawkesworth) notes: diff --git a/lib/ansible/modules/windows/win_scheduled_task.ps1 b/lib/ansible/modules/windows/win_scheduled_task.ps1 index 4a466f5ddd..a9d39b4ede 100644 --- a/lib/ansible/modules/windows/win_scheduled_task.ps1 +++ b/lib/ansible/modules/windows/win_scheduled_task.ps1 @@ -1,9 +1,8 @@ #!powershell -# This file is part of Ansible -# Copyright 2015, Peter Mounce -# Michael Perzel -# Copyright (c) 2017 Ansible Project +# Copyright: (c) 2015, Peter Mounce +# Copyright: (c) 2015, Michael Perzel +# Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/lib/ansible/modules/windows/win_scheduled_task.py b/lib/ansible/modules/windows/win_scheduled_task.py index bb0ba1412e..a11ebbb740 100644 --- a/lib/ansible/modules/windows/win_scheduled_task.py +++ b/lib/ansible/modules/windows/win_scheduled_task.py @@ -53,6 +53,7 @@ options: is kept when modifying the task. - This module only supports the C(ExecAction) type but can still delete the older legacy types. + type: list suboptions: path: description: @@ -78,6 +79,7 @@ options: - DEPRECATED since 2.5, use the C(actions) option instead to specify a list of actions to run. - Will be removed in 2.7. + type: path # Trigger options triggers: @@ -90,6 +92,7 @@ options: for a list of trigger types and their options. - The suboption options listed below are not required for all trigger types, read the description for more details. + type: list suboptions: type: description: @@ -209,6 +212,7 @@ options: - DEPRECATED since 2.5, use the C(triggers) option list with the type of C(monthlydow) or C(weekly). - Will be removed in 2.7. + type: list frequency: description: - The frequency of the task to run. @@ -330,6 +334,7 @@ options: - C(0) means the task is compatible with the AT command. - C(1) means the task is compatible with Task Scheduler 1.0. - C(2) means the task is compatible with Task Scheduler 2.0. + type: int choices: [ 0, 1, 2 ] version_added: '2.5' delete_expired_task_after: @@ -372,6 +377,7 @@ options: before starting itself. - C(2) will not start a new instance if another is running. - C(3) will stop other instances of the task and start the new one. + type: int choices: [ 0, 1, 2, 3 ] version_added: '2.5' priority: @@ -380,11 +386,13 @@ options: - When creating a new task the default if C(7). - See U(https://msdn.microsoft.com/en-us/library/windows/desktop/aa383512.aspx) for details on the priority levels. + type: int version_added: '2.5' restart_count: description: - The number of times that the Task Scheduler will attempt to restart the task. + type: int version_added: '2.5' restart_interval: description: diff --git a/lib/ansible/modules/windows/win_scheduled_task_stat.ps1 b/lib/ansible/modules/windows/win_scheduled_task_stat.ps1 index e5a4960182..328c15dae5 100644 --- a/lib/ansible/modules/windows/win_scheduled_task_stat.ps1 +++ b/lib/ansible/modules/windows/win_scheduled_task_stat.ps1 @@ -1,6 +1,6 @@ #!powershell -# Copyright (c) 2017 Ansible Project +# Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.CamelConversion diff --git a/lib/ansible/modules/windows/win_security_policy.ps1 b/lib/ansible/modules/windows/win_security_policy.ps1 index 44d89ca0ce..eaae4774cd 100644 --- a/lib/ansible/modules/windows/win_security_policy.ps1 +++ b/lib/ansible/modules/windows/win_security_policy.ps1 @@ -1,23 +1,9 @@ #!powershell -# This file is part of Ansible -# -# Copyright 2017, Jordan Borean -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# WANT_JSON -# POWERSHELL_COMMON +# Copyright: (c) 2017, Jordan Borean +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +#Requires -Module Ansible.ModuleUtils.Legacy $ErrorActionPreference = 'Stop' diff --git a/lib/ansible/modules/windows/win_service.ps1 b/lib/ansible/modules/windows/win_service.ps1 index cdd1232d0a..dabdeee503 100644 --- a/lib/ansible/modules/windows/win_service.ps1 +++ b/lib/ansible/modules/windows/win_service.ps1 @@ -1,7 +1,6 @@ #!powershell -# This file is part of Ansible -# Copyright 2014, Chris Hoffman +# Copyright: (c) 2014, Chris Hoffman # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/lib/ansible/modules/windows/win_service.py b/lib/ansible/modules/windows/win_service.py index 3110348c65..e91529f357 100644 --- a/lib/ansible/modules/windows/win_service.py +++ b/lib/ansible/modules/windows/win_service.py @@ -24,6 +24,7 @@ options: service. - This works by C(dependency_action) to either add/remove or set the services in this list. + type: list version_added: "2.3" dependency_action: description: diff --git a/lib/ansible/modules/windows/win_share.ps1 b/lib/ansible/modules/windows/win_share.ps1 index 4e3e7aa68a..01a4275c2a 100644 --- a/lib/ansible/modules/windows/win_share.ps1 +++ b/lib/ansible/modules/windows/win_share.ps1 @@ -1,5 +1,6 @@ #!powershell -# Copyright 2015, Hans-Joachim Kliemeck + +# Copyright: (c) 2015, Hans-Joachim Kliemeck # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/lib/ansible/modules/windows/win_share.py b/lib/ansible/modules/windows/win_share.py index 96e05d8e75..429b938e53 100644 --- a/lib/ansible/modules/windows/win_share.py +++ b/lib/ansible/modules/windows/win_share.py @@ -30,6 +30,7 @@ options: description: - Share directory. required: yes + type: path state: description: - Specify whether to add C(present) or remove C(absent) the specified share. diff --git a/lib/ansible/modules/windows/win_shell.ps1 b/lib/ansible/modules/windows/win_shell.ps1 index 9120df02d2..47b5dfb9bf 100644 --- a/lib/ansible/modules/windows/win_shell.ps1 +++ b/lib/ansible/modules/windows/win_shell.ps1 @@ -1,7 +1,6 @@ #!powershell -# This file is part of Ansible -# Copyright (c) 2017 Ansible Project +# Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/lib/ansible/modules/windows/win_shell.py b/lib/ansible/modules/windows/win_shell.py index 8f16be8a8e..42cb213e66 100644 --- a/lib/ansible/modules/windows/win_shell.py +++ b/lib/ansible/modules/windows/win_shell.py @@ -27,16 +27,20 @@ options: creates: description: - A path or path filter pattern; when the referenced path exists on the target host, the task will be skipped. + type: path removes: description: - A path or path filter pattern; when the referenced path B(does not) exist on the target host, the task will be skipped. + type: path chdir: description: - Set the specified path as the current working directory before executing a command + type: path executable: description: - Change the shell used to execute the command (eg, C(cmd)). - The target shell must accept a C(/c) parameter followed by the raw command line to be executed. + type: path stdin: description: - Set the stdin of the command directly to the specified value. diff --git a/lib/ansible/modules/windows/win_shortcut.ps1 b/lib/ansible/modules/windows/win_shortcut.ps1 index e4e996c5ec..bc9e89377e 100644 --- a/lib/ansible/modules/windows/win_shortcut.ps1 +++ b/lib/ansible/modules/windows/win_shortcut.ps1 @@ -14,13 +14,13 @@ $check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "b $orig_src = Get-AnsibleParam -obj $params -name "src" $dest = Get-AnsibleParam -obj $params -name "dest" -type "path" -failifempty $true -$state = Get-AnsibleParam -obj $params -name "state" -type "string" -default "present" -validateset "absent","present" -$orig_args = Get-AnsibleParam -obj $params -name "args" -type "string" +$state = Get-AnsibleParam -obj $params -name "state" -type "str" -default "present" -validateset "absent","present" +$orig_args = Get-AnsibleParam -obj $params -name "args" -type "str" $directory = Get-AnsibleParam -obj $params -name "directory" -type "path" -$hotkey = Get-AnsibleParam -obj $params -name "hotkey" -type "string" +$hotkey = Get-AnsibleParam -obj $params -name "hotkey" -type "str" $icon = Get-AnsibleParam -obj $params -name "icon" -type "path" -$orig_description = Get-AnsibleParam -obj $params -name "description" -type "string" -$windowstyle = Get-AnsibleParam -obj $params -name "windowstyle" -type "string" -validateset "maximized","minimized","normal" +$orig_description = Get-AnsibleParam -obj $params -name "description" -type "str" +$windowstyle = Get-AnsibleParam -obj $params -name "windowstyle" -type "str" -validateset "maximized","minimized","normal" # Expand environment variables on non-path types $args = Expand-Environment($orig_args) diff --git a/lib/ansible/modules/windows/win_shortcut.py b/lib/ansible/modules/windows/win_shortcut.py index fe167690cf..66db802bed 100644 --- a/lib/ansible/modules/windows/win_shortcut.py +++ b/lib/ansible/modules/windows/win_shortcut.py @@ -30,17 +30,20 @@ options: - Destination file for the shortcuting file. - File name should have a C(.lnk) or C(.url) extension. required: yes + type: path args: description: - Additional arguments for the executable defined in C(src). directory: description: - Working directory for executable defined in C(src). + type: path icon: description: - Icon used for the shortcut. - File name should have a C(.ico) extension. - The file name is followed by a comma and the number in the library file (.dll) or use 0 for an image file. + type: path hotkey: description: - Key combination for the shortcut. diff --git a/lib/ansible/modules/windows/win_stat.ps1 b/lib/ansible/modules/windows/win_stat.ps1 index b705b8db8b..f44e9b848d 100644 --- a/lib/ansible/modules/windows/win_stat.ps1 +++ b/lib/ansible/modules/windows/win_stat.ps1 @@ -1,7 +1,6 @@ #!powershell -# This file is part of Ansible -# Copyright (c) 2017 Ansible Project +# Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/lib/ansible/modules/windows/win_stat.py b/lib/ansible/modules/windows/win_stat.py index 4aeaa3497e..5b989cb34e 100644 --- a/lib/ansible/modules/windows/win_stat.py +++ b/lib/ansible/modules/windows/win_stat.py @@ -25,6 +25,7 @@ options: - The full path of the file/object to get the facts of; both forward and back slashes are accepted. required: yes + type: path get_md5: description: - Whether to return the checksum sum of the file. Between Ansible 1.9 diff --git a/lib/ansible/modules/windows/win_tempfile.ps1 b/lib/ansible/modules/windows/win_tempfile.ps1 index 5e4419f3d8..f3c1d11c9f 100644 --- a/lib/ansible/modules/windows/win_tempfile.ps1 +++ b/lib/ansible/modules/windows/win_tempfile.ps1 @@ -1,5 +1,4 @@ #!powershell -# -*- coding: utf-8 -*- # Copyright: (c) 2017, Dag Wieers (@dagwieers) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) @@ -38,9 +37,9 @@ $params = Parse-Args $args -supports_check_mode $true $check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false $path = Get-AnsibleParam -obj $params -name "path" -type "path" -default "%TEMP%" -aliases "dest" -$state = Get-AnsibleParam -obj $params -name "state" -type "string" -default "file" -validateset "file","directory" -$prefix = Get-AnsibleParam -obj $params -name "prefix" -type "string" -default "ansible." -$suffix = Get-AnsibleParam -obj $params -name "suffix" -type "string" +$state = Get-AnsibleParam -obj $params -name "state" -type "str" -default "file" -validateset "file","directory" +$prefix = Get-AnsibleParam -obj $params -name "prefix" -type "str" -default "ansible." +$suffix = Get-AnsibleParam -obj $params -name "suffix" -type "str" # Expand environment variables on non-path types $prefix = Expand-Environment($prefix) diff --git a/lib/ansible/modules/windows/win_tempfile.py b/lib/ansible/modules/windows/win_tempfile.py index 1432a376b8..7b5313eb86 100644 --- a/lib/ansible/modules/windows/win_tempfile.py +++ b/lib/ansible/modules/windows/win_tempfile.py @@ -1,7 +1,7 @@ #!/usr/bin/python # coding: utf-8 -*- -# Copyright: (c) 2017 Dag Wieers +# Copyright: (c) 2017, Dag Wieers # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', @@ -28,6 +28,7 @@ options: description: - Location where temporary file or directory should be created. - If path is not specified default system temporary directory (%TEMP%) will be used. + type: path default: '%TEMP%' prefix: description: diff --git a/lib/ansible/modules/windows/win_timezone.ps1 b/lib/ansible/modules/windows/win_timezone.ps1 index 0718d90cb4..0f609b1584 100644 --- a/lib/ansible/modules/windows/win_timezone.ps1 +++ b/lib/ansible/modules/windows/win_timezone.ps1 @@ -1,23 +1,9 @@ #!powershell -# This file is part of Ansible -# -# Copyright 2015, Phil Schwartz -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# WANT_JSON -# POWERSHELL_COMMON +# Copyright: (c) 2015, Phil Schwartz +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +#Requires -Module Ansible.ModuleUtils.Legacy $params = Parse-Args $args -supports_check_mode $true $check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false diff --git a/lib/ansible/modules/windows/win_toast.ps1 b/lib/ansible/modules/windows/win_toast.ps1 index 6208f0d75a..0be3278e09 100644 --- a/lib/ansible/modules/windows/win_toast.ps1 +++ b/lib/ansible/modules/windows/win_toast.ps1 @@ -1,8 +1,7 @@ #!powershell -# This file is part of Ansible -# Copyright (c) 2017, Jon Hawkesworth (@jhawkesworth) -# Copyright (c) 2017 Ansible Project +# Copyright: (c) 2017, Jon Hawkesworth (@jhawkesworth) +# Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/lib/ansible/modules/windows/win_toast.py b/lib/ansible/modules/windows/win_toast.py index f4c9ff22c7..0fe2ae1b60 100644 --- a/lib/ansible/modules/windows/win_toast.py +++ b/lib/ansible/modules/windows/win_toast.py @@ -23,6 +23,7 @@ options: expire: description: - How long in seconds before the notification expires. + type: int default: 45 group: description: diff --git a/lib/ansible/modules/windows/win_unzip.ps1 b/lib/ansible/modules/windows/win_unzip.ps1 index fba2b18ef9..4bcf9a9406 100644 --- a/lib/ansible/modules/windows/win_unzip.ps1 +++ b/lib/ansible/modules/windows/win_unzip.ps1 @@ -1,23 +1,9 @@ #!powershell -# This file is part of Ansible -# -# Copyright 2015, Phil Schwartz -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# WANT_JSON -# POWERSHELL_COMMON +# Copyright: (c) 2015, Phil Schwartz +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +#Requires -Module Ansible.ModuleUtils.Legacy # TODO: This module is not idempotent (it will always unzip and report change) diff --git a/lib/ansible/modules/windows/win_unzip.py b/lib/ansible/modules/windows/win_unzip.py index d6d2f1491c..1ee741ba18 100644 --- a/lib/ansible/modules/windows/win_unzip.py +++ b/lib/ansible/modules/windows/win_unzip.py @@ -28,10 +28,12 @@ options: description: - File to be unzipped (provide absolute path). required: yes + type: path dest: description: - Destination of zip file (provide absolute path of directory). If it does not exist, the directory will be created. required: yes + type: path delete_archive: description: - Remove the zip file, after unzipping. @@ -47,6 +49,7 @@ options: creates: description: - If this file or directory exists the specified src will not be extracted. + type: path notes: - This module is not really idempotent, it will extract the archive every time, and report a change. - For extracting any compression types other than .zip, the PowerShellCommunityExtensions (PSCX) Module is required. This module (in conjunction with PSCX) diff --git a/lib/ansible/modules/windows/win_updates.ps1 b/lib/ansible/modules/windows/win_updates.ps1 index 0962d36669..cd4ca990b9 100644 --- a/lib/ansible/modules/windows/win_updates.ps1 +++ b/lib/ansible/modules/windows/win_updates.ps1 @@ -1,8 +1,7 @@ #!powershell -# This file is part of Ansible -# Copyright 2015, Matt Davis -# Copyright (c) 2017 Ansible Project +# Copyright: (c) 2015, Matt Davis +# Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/lib/ansible/modules/windows/win_updates.py b/lib/ansible/modules/windows/win_updates.py index 9f6d4337ad..0feb07cfc7 100644 --- a/lib/ansible/modules/windows/win_updates.py +++ b/lib/ansible/modules/windows/win_updates.py @@ -29,10 +29,12 @@ options: skipped and not installed. - Each entry can either be the KB article or Update title as a regex according to the PowerShell regex rules. + type: list version_added: '2.5' category_names: description: - A scalar or list of categories to install updates from + type: list default: [ CriticalUpdates, SecurityUpdates, UpdateRollups ] choices: - Application @@ -73,6 +75,7 @@ options: log_path: description: - If set, C(win_updates) will append update progress to the specified file. The directory must already exist. + type: path whitelist: description: - A list of update titles or KB numbers that can be used to specify @@ -84,6 +87,7 @@ options: - The whitelist is only validated on updates that were found based on I(category_names). It will not force the module to install an update if it was not in the category specified. + type: list version_added: '2.5' use_scheduled_task: description: diff --git a/lib/ansible/modules/windows/win_uri.py b/lib/ansible/modules/windows/win_uri.py index c30c8967bb..36042bf29b 100644 --- a/lib/ansible/modules/windows/win_uri.py +++ b/lib/ansible/modules/windows/win_uri.py @@ -55,6 +55,7 @@ options: dest: description: - Output the response body to a file. + type: path version_added: '2.3' headers: description: @@ -74,10 +75,12 @@ options: creates: description: - A filename, when it already exists, this step will be skipped. + type: path version_added: '2.4' removes: description: - A filename, when it does not exist, this step will be skipped. + type: path version_added: '2.4' return_content: description: @@ -92,6 +95,7 @@ options: description: - A valid, numeric, HTTP status code that signifies success of the request. - Can also be comma separated list of status codes. + type: list default: 200 version_added: '2.4' timeout: @@ -102,6 +106,7 @@ options: If your request contains a host name that requires resolution, and you set C(timeout) to a value greater than zero, but less than 15 seconds, it can take 15 seconds or more before your request times out. + type: int default: 30 version_added: '2.4' follow_redirects: @@ -121,6 +126,7 @@ options: - If C(maximum_redirection) is set to 0 (zero) or C(follow_redirects) is set to C(none), or set to C(safe) when not doing C(GET) or C(HEAD) it prevents all redirection. + type: int default: 5 version_added: '2.4' validate_certs: @@ -138,6 +144,7 @@ options: certificate file is not password protected. - Other authentication types can set I(client_cert_password) when the cert is password protected. + type: path version_added: '2.4' client_cert_password: description: diff --git a/lib/ansible/modules/windows/win_user.ps1 b/lib/ansible/modules/windows/win_user.ps1 index 9216331716..4c2267755b 100644 --- a/lib/ansible/modules/windows/win_user.ps1 +++ b/lib/ansible/modules/windows/win_user.ps1 @@ -1,23 +1,9 @@ #!powershell -# This file is part of Ansible -# -# Copyright 2014, Paul Durivage -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . -# WANT_JSON -# POWERSHELL_COMMON +# Copyright: (c) 2014, Paul Durivage +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +#Requires -Module Ansible.ModuleUtils.Legacy ######## $ADS_UF_PASSWD_CANT_CHANGE = 64 diff --git a/lib/ansible/modules/windows/win_user_right.ps1 b/lib/ansible/modules/windows/win_user_right.ps1 index b65bf21d42..01d328025b 100644 --- a/lib/ansible/modules/windows/win_user_right.ps1 +++ b/lib/ansible/modules/windows/win_user_right.ps1 @@ -1,7 +1,6 @@ #!powershell -# This file is part of Ansible -# Copyright (c) 2017 Ansible Project +# Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/lib/ansible/modules/windows/win_user_right.py b/lib/ansible/modules/windows/win_user_right.py index 2dfadba758..82fe72aaa4 100644 --- a/lib/ansible/modules/windows/win_user_right.py +++ b/lib/ansible/modules/windows/win_user_right.py @@ -38,6 +38,7 @@ options: SERVERNAME\user-group where SERVERNAME is the name of the remote server. - You can also add special local accounts like SYSTEM and others. required: yes + type: list action: description: - C(add) will add the users/groups to the existing right. diff --git a/lib/ansible/modules/windows/win_wait_for.ps1 b/lib/ansible/modules/windows/win_wait_for.ps1 index 66fd884dea..8b78088848 100644 --- a/lib/ansible/modules/windows/win_wait_for.ps1 +++ b/lib/ansible/modules/windows/win_wait_for.ps1 @@ -1,7 +1,6 @@ #!powershell -# This file is part of Ansible -# Copyright (c) 2017 Ansible Project +# Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy @@ -17,7 +16,7 @@ $exclude_hosts = Get-AnsibleParam -obj $params -name "exclude_hosts" -type "list $hostname = Get-AnsibleParam -obj $params -name "host" -type "str" -default "127.0.0.1" $path = Get-AnsibleParam -obj $params -name "path" -type "path" $port = Get-AnsibleParam -obj $params -name "port" -type "int" -$search_regex = Get-AnsibleParam -obj $params -name "search_regex" -type "string" +$search_regex = Get-AnsibleParam -obj $params -name "search_regex" -type "str" $sleep = Get-AnsibleParam -obj $params -name "sleep" -type "int" -default 1 $state = Get-AnsibleParam -obj $params -name "state" -type "str" -default "started" -validateset "present","started","stopped","absent","drained" $timeout = Get-AnsibleParam -obj $params -name "timeout" -type "int" -default 300 diff --git a/lib/ansible/modules/windows/win_wait_for.py b/lib/ansible/modules/windows/win_wait_for.py index 4aec8de71b..4d51687857 100644 --- a/lib/ansible/modules/windows/win_wait_for.py +++ b/lib/ansible/modules/windows/win_wait_for.py @@ -32,14 +32,17 @@ options: description: - The maximum number of seconds to wait for a connection to happen before closing and retrying. + type: int default: 5 delay: description: - The number of seconds to wait before starting to poll. + type: int exclude_hosts: description: - The list of hosts or IPs to ignore when looking for active TCP connections when C(state=drained). + type: list host: description: - A resolvable hostname or IP address to wait for. @@ -52,9 +55,11 @@ options: - If C(state) is present or started then it will wait until the file exists. - If C(state) is absent then it will wait until the file does not exist. + type: path port: description: - The port number to poll on C(host). + type: int search_regex: description: - Can be used to match a string in a file. @@ -65,6 +70,7 @@ options: sleep: description: - Number of seconds to sleep between checks. + type: int default: 1 state: description: @@ -79,6 +85,7 @@ options: timeout: description: - The maximum number of seconds to wait for. + type: int default: 300 author: - Jordan Borean (@jborean93) diff --git a/lib/ansible/modules/windows/win_wakeonlan.ps1 b/lib/ansible/modules/windows/win_wakeonlan.ps1 index e9abdcb474..e428c169aa 100644 --- a/lib/ansible/modules/windows/win_wakeonlan.ps1 +++ b/lib/ansible/modules/windows/win_wakeonlan.ps1 @@ -1,5 +1,4 @@ #!powershell -# -*- coding: utf-8 -*- # Copyright: (c) 2017, Dag Wieers (@dagwieers) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) diff --git a/lib/ansible/modules/windows/win_wakeonlan.py b/lib/ansible/modules/windows/win_wakeonlan.py index ddb1868ea1..ff1a6ebfe2 100644 --- a/lib/ansible/modules/windows/win_wakeonlan.py +++ b/lib/ansible/modules/windows/win_wakeonlan.py @@ -27,6 +27,7 @@ options: port: description: - UDP port to use for magic Wake-on-LAN packet. + type: int default: 7 author: - Dag Wieers (@dagwieers) diff --git a/lib/ansible/modules/windows/win_webpicmd.ps1 b/lib/ansible/modules/windows/win_webpicmd.ps1 index 802aa05166..b1a7385c87 100644 --- a/lib/ansible/modules/windows/win_webpicmd.ps1 +++ b/lib/ansible/modules/windows/win_webpicmd.ps1 @@ -1,26 +1,12 @@ #!powershell -# This file is part of Ansible -# -# Copyright 2015, Peter Mounce -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . + +# Copyright: (c) 2015, Peter Mounce +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +#Requires -Module Ansible.ModuleUtils.Legacy $ErrorActionPreference = "Stop" -# WANT_JSON -# POWERSHELL_COMMON - Function Find-Command { [CmdletBinding()] diff --git a/lib/ansible/modules/windows/win_whoami.ps1 b/lib/ansible/modules/windows/win_whoami.ps1 index e6b6fae08b..16988208a9 100644 --- a/lib/ansible/modules/windows/win_whoami.ps1 +++ b/lib/ansible/modules/windows/win_whoami.ps1 @@ -1,7 +1,6 @@ #!powershell -# This file is part of Ansible -# Copyright (c) 2017 Ansible Project +# Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) #Requires -Module Ansible.ModuleUtils.Legacy diff --git a/test/sanity/pslint/ignore.txt b/test/sanity/pslint/ignore.txt index 219677b394..f265fbd3e7 100644 --- a/test/sanity/pslint/ignore.txt +++ b/test/sanity/pslint/ignore.txt @@ -51,7 +51,6 @@ lib/ansible/modules/windows/win_dsc.ps1 PSAvoidUsingConvertToSecureStringWithPla lib/ansible/modules/windows/win_dsc.ps1 PSAvoidUsingEmptyCatchBlock lib/ansible/modules/windows/win_dsc.ps1 PSUseApprovedVerbs lib/ansible/modules/windows/win_eventlog.ps1 PSUseDeclaredVarsMoreThanAssignments -lib/ansible/modules/windows/win_file_version.ps1 PSUseBOMForUnicodeEncodedFile lib/ansible/modules/windows/win_find.ps1 PSAvoidUsingEmptyCatchBlock lib/ansible/modules/windows/win_find.ps1 PSAvoidUsingWMICmdlet lib/ansible/modules/windows/win_firewall_rule.ps1 PSAvoidUsingCmdletAliases