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
pull/42844/merge
Dag Wieers 6 years ago committed by Matt Davis
parent 290df027e3
commit 95a1170908

@ -1,23 +1,9 @@
#!powershell #!powershell
# (c) 2014, Matt Martz <matt@sivel.net>, and others
# # Copyright: (c) 2014, Matt Martz <matt@sivel.net>, and others
# This file is part of Ansible # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# Ansible is free software: you can redistribute it and/or modify #Requires -Module Ansible.ModuleUtils.Legacy
# 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 <http://www.gnu.org/licenses/>.
# WANT_JSON
# POWERSHELL_COMMON
$params = Parse-Args $args -supports_check_mode $true $params = Parse-Args $args -supports_check_mode $true
$check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false $check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false

@ -28,6 +28,7 @@ options:
description: description:
- File system path to the MSI file to install. - File system path to the MSI file to install.
required: yes required: yes
type: path
extra_args: extra_args:
description: description:
- Additional arguments to pass to the msiexec.exe command. - Additional arguments to pass to the msiexec.exe command.
@ -40,10 +41,12 @@ options:
description: description:
- Path to a file created by installing the MSI to prevent from - Path to a file created by installing the MSI to prevent from
attempting to reinstall the package on every run. attempting to reinstall the package on every run.
type: path
removes: removes:
description: description:
- Path to a file removed by uninstalling the MSI to prevent from - Path to a file removed by uninstalling the MSI to prevent from
attempting to re-uninstall the package on every run. attempting to re-uninstall the package on every run.
type: path
version_added: '2.4' version_added: '2.4'
wait: wait:
description: description:

@ -1,21 +1,8 @@
#!powershell #!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 <http://www.gnu.org/licenses/>.
# WANT_JSON # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# POWERSHELL_COMMON
#Requires -Module Ansible.ModuleUtils.Legacy
$results = @{changed=$false} $results = @{changed=$false}

@ -1,6 +1,6 @@
#!powershell #!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) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#Requires -Module Ansible.ModuleUtils.Legacy #Requires -Module Ansible.ModuleUtils.Legacy

@ -1,21 +1,8 @@
#!powershell #!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 <http://www.gnu.org/licenses/>.
# WANT_JSON # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# POWERSHELL_COMMON
#Requires -Module Ansible.ModuleUtils.Legacy
$params = Parse-Args $args -supports_check_mode $true; $params = Parse-Args $args -supports_check_mode $true;
$src = Get-AnsibleParam -obj $params -name "src" -type "path" -aliases "path" -failifempty $true; $src = Get-AnsibleParam -obj $params -name "src" -type "path" -aliases "path" -failifempty $true;

@ -1,7 +1,8 @@
#!powershell #!powershell
# Copyright 2015, Phil Schwartz <schwartzmx@gmail.com>
# Copyright 2015, Trond Hindenes # Copyright: (c) 2015, Phil Schwartz <schwartzmx@gmail.com>
# Copyright 2015, Hans-Joachim Kliemeck <git@kliemeck.de> # Copyright: (c) 2015, Trond Hindenes
# Copyright: (c) 2015, Hans-Joachim Kliemeck <git@kliemeck.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#Requires -Module Ansible.ModuleUtils.Legacy #Requires -Module Ansible.ModuleUtils.Legacy

@ -1,23 +1,9 @@
#!powershell #!powershell
# This file is part of Ansible
#
# Copyright 2015, Hans-Joachim Kliemeck <git@kliemeck.de>
#
# 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 <http://www.gnu.org/licenses/>.
# WANT_JSON # Copyright: (c) 2015, Hans-Joachim Kliemeck <git@kliemeck.de>
# 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 $params = Parse-Args $args -supports_check_mode $true
$check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -default $false $check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -default $false

@ -23,6 +23,7 @@ options:
description: description:
- Path to be used for changing inheritance - Path to be used for changing inheritance
required: yes required: yes
type: path
state: state:
description: description:
- Specify whether to enable I(present) or disable I(absent) ACL inheritance - Specify whether to enable I(present) or disable I(absent) ACL inheritance

@ -1,4 +1,5 @@
#!powershell #!powershell
# Copyright: (c) 2017, Noah Sparks <nsparks@outlook.com> # Copyright: (c) 2017, Noah Sparks <nsparks@outlook.com>
# 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) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

@ -34,8 +34,9 @@ options:
description: description:
- The type of event you would like to audit for. - The type of event you would like to audit for.
- Accepts a list. See examples. - Accepts a list. See examples.
choices: [ failure, none, success ]
required: yes required: yes
type: list
choices: [ failure, none, success ]
''' '''
EXAMPLES = r''' EXAMPLES = r'''

@ -28,6 +28,7 @@ options:
- Registry paths should be in Powershell format, beginning with an abbreviation for the root - Registry paths should be in Powershell format, beginning with an abbreviation for the root
such as, 'hklm:\software'. such as, 'hklm:\software'.
required: yes required: yes
type: path
aliases: [ dest, destination ] aliases: [ dest, destination ]
user: user:
description: description:
@ -41,12 +42,14 @@ options:
- If I(path) is a registry key, rights can be any right under MSDN - 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). RegistryRights U(https://msdn.microsoft.com/en-us/library/system.security.accesscontrol.registryrights.aspx).
required: yes required: yes
type: list
inheritance_flags: inheritance_flags:
description: description:
- Defines what objects inside of a folder or registry key will inherit the settings. - 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). - 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 - For more information on the choices see MSDN PropagationFlags enumeration
at U(https://msdn.microsoft.com/en-us/library/system.security.accesscontrol.inheritanceflags.aspx). at U(https://msdn.microsoft.com/en-us/library/system.security.accesscontrol.inheritanceflags.aspx).
type: list
default: "ContainerInherit,ObjectInherit" default: "ContainerInherit,ObjectInherit"
choices: [ ContainerInherit, ObjectInherit ] choices: [ ContainerInherit, ObjectInherit ]
propagation_flags: propagation_flags:
@ -62,6 +65,7 @@ options:
- Defines whether to log on failure, success, or both. - Defines whether to log on failure, success, or both.
- To log both define as comma seperated list "Success, Failure". - To log both define as comma seperated list "Success, Failure".
required: yes required: yes
type: list
choices: [ Failure, Success ] choices: [ Failure, Success ]
state: state:
description: description:

@ -1,5 +1,4 @@
#!powershell #!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) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

@ -40,6 +40,7 @@ options:
- This is required when I(state) is C(present) or C(exported). - 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 - When I(state) is C(absent) and I(thumbprint) is not specified, the
thumbprint is derived from the certificate at this path. thumbprint is derived from the certificate at this path.
type: path
thumbprint: thumbprint:
description: description:
- The thumbprint as a hex string to either export or remove. - The thumbprint as a hex string to either export or remove.

@ -80,6 +80,7 @@ options:
timeout: timeout:
description: description:
- The time to allow chocolatey to finish before timing out. - The time to allow chocolatey to finish before timing out.
type: int
default: 2700 default: 2700
version_added: '2.3' version_added: '2.3'
aliases: [ execution_timeout ] aliases: [ execution_timeout ]

@ -1,7 +1,6 @@
#!powershell #!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) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#Requires -Module Ansible.ModuleUtils.Legacy #Requires -Module Ansible.ModuleUtils.Legacy

@ -29,12 +29,15 @@ options:
creates: creates:
description: description:
- A path or path filter pattern; when the referenced path exists on the target host, the task will be skipped. - A path or path filter pattern; when the referenced path exists on the target host, the task will be skipped.
type: path
removes: removes:
description: description:
- A path or path filter pattern; when the referenced path B(does not) exist on the target host, the task will be skipped. - 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: chdir:
description: description:
- Set the specified path as the current working directory before executing a command. - Set the specified path as the current working directory before executing a command.
type: path
stdin: stdin:
description: description:
- Set the stdin of the command directly to the specified value. - Set the stdin of the command directly to the specified value.

@ -1,5 +1,4 @@
#!powershell #!powershell
# This file is part of Ansible
# Copyright: (c) 2015, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk> # Copyright: (c) 2015, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk>
# Copyright: (c) 2017, Ansible Project # Copyright: (c) 2017, Ansible Project

@ -42,6 +42,7 @@ options:
- If C(src) and C(dest) are files and if the parent directory of C(dest) - If C(src) and C(dest) are files and if the parent directory of C(dest)
doesn't exist, then the task will fail. doesn't exist, then the task will fail.
required: yes required: yes
type: path
force: force:
description: description:
- If set to C(yes), the file will only be transferred if the content - 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 - If path is a file and dest ends with "\", the file is copied to the
folder with the same filename. folder with the same filename.
required: yes required: yes
type: path
notes: notes:
- For non-Windows targets, use the M(copy) module instead. - For non-Windows targets, use the M(copy) module instead.
- Currently win_copy does not support copying symbolic links from both local to - Currently win_copy does not support copying symbolic links from both local to

@ -1,5 +1,4 @@
#!powershell #!powershell
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Dag Wieers (@dagwieers) <dag@wieers.com> # Copyright: (c) 2017, Dag Wieers (@dagwieers) <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # 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" $include_volumes = Get-AnsibleParam -obj $params -name "include_volumes" -type "list"
$exclude_volumes = Get-AnsibleParam -obj $params -name "exclude_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 $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 $parallel = Get-AnsibleParam -obj $params -name "parallel" -type "bool" -default $false
$result = @{ $result = @{

@ -21,9 +21,11 @@ options:
description: description:
- A list of drive letters or mount point paths of the volumes to be defragmented. - 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. - If this parameter is omitted, all volumes (not excluded) will be fragmented.
type: list
exclude_volumes: exclude_volumes:
description: description:
- A list of drive letters or mount point paths to exclude from defragmentation. - A list of drive letters or mount point paths to exclude from defragmentation.
type: list
freespace_consolidation: freespace_consolidation:
description: description:
- Perform free space consolidation on the specified volumes. - Perform free space consolidation on the specified volumes.

@ -5,6 +5,7 @@
#Requires -Module Ansible.ModuleUtils.Legacy #Requires -Module Ansible.ModuleUtils.Legacy
#AnsibleRequires -OSVersion 6.2 #AnsibleRequires -OSVersion 6.2
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
Set-StrictMode -Version 2.0 Set-StrictMode -Version 2.0

@ -1,24 +1,9 @@
#!powershell #!powershell
# (c) 2017, Red Hat, Inc. # Copyright: (c) 2017, Red Hat, Inc.
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This file is part of Ansible
# #Requires -Module Ansible.ModuleUtils.Legacy
# 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 <http://www.gnu.org/licenses/>.
# POWERSHELL_COMMON
# WANT_JSON
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
Set-StrictMode -Version 2 Set-StrictMode -Version 2
@ -88,4 +73,4 @@ ElseIf($state -eq "absent") {
} }
} }
Exit-Json $result Exit-Json $result

@ -1,21 +1,8 @@
#!powershell #!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)
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by #Requires -Module Ansible.ModuleUtils.Legacy
# 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 <http://www.gnu.org/licenses/>.
# WANT_JSON
# POWERSHELL_COMMON
# FUTURE: check statically-set values via registry so we can determine difference between DHCP-source values and static values? (prevent spurious changed # 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) # notifications on DHCP-sourced values)

@ -1,21 +1,8 @@
#!powershell #!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)
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by #Requires -Module Ansible.ModuleUtils.Legacy
# 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 <http://www.gnu.org/licenses/>.
# WANT_JSON
# POWERSHELL_COMMON
Set-StrictMode -Version 2 Set-StrictMode -Version 2
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
@ -35,13 +22,13 @@ Function Ensure-Prereqs {
} }
} }
$parsed_args = Parse-Args $args -supports_check_mode $true $params = Parse-Args $args -supports_check_mode $true
$check_mode = Get-AnsibleParam $parsed_args "_ansible_check_mode" -default $false $check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -default $false
$dns_domain_name = Get-AnsibleParam $parsed_args "dns_domain_name" -failifempty $true $dns_domain_name = Get-AnsibleParam -obj $params -name "dns_domain_name" -failifempty $true
$domain_netbios_name = Get-AnsibleParam $parsed_args "domain_netbios_name" $domain_netbios_name = Get-AnsibleParam -obj $params -name "domain_netbios_name"
$safe_mode_admin_password = Get-AnsibleParam $parsed_args "safe_mode_password" -failifempty $true $safe_mode_admin_password = Get-AnsibleParam -obj $params -name "safe_mode_password" -failifempty $true
$database_path = Get-AnsibleParam $parsed_args "database_path" -type "path" $database_path = Get-AnsibleParam -obj $params -name "database_path" -type "path"
$sysvol_path = Get-AnsibleParam $parsed_args "sysvol_path" -type "path" $sysvol_path = Get-AnsibleParam -obj $params -name "sysvol_path" -type "path"
$forest = $null $forest = $null

@ -35,12 +35,14 @@ options:
- The path to a directory on a fixed disk of the Windows host where the - The path to a directory on a fixed disk of the Windows host where the
domain database will be created. domain database will be created.
- If not set then the default path is C(%SYSTEMROOT%\NTDS). - If not set then the default path is C(%SYSTEMROOT%\NTDS).
type: path
version_added: '2.5' version_added: '2.5'
sysvol_path: sysvol_path:
description: description:
- The path to a directory on a fixed disk of the Windows host where the - The path to a directory on a fixed disk of the Windows host where the
Sysvol file will be created. Sysvol file will be created.
- If not set then the default path is C(%SYSTEMROOT%\SYSVOL). - If not set then the default path is C(%SYSTEMROOT%\SYSVOL).
type: path
version_added: '2.5' version_added: '2.5'
author: author:
- Matt Davis (@nitzmahone) - Matt Davis (@nitzmahone)

@ -1,5 +1,5 @@
#!powershell #!powershell
#
# Copyright: (c) 2017, AMTEGA - Xunta de Galicia # 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) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

@ -1,5 +1,4 @@
#!powershell #!powershell
# This file is part of Ansible
# Copyright: (c) 2017, Red Hat, Inc. # Copyright: (c) 2017, Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # 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 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" $dns_domain_name = Get-AnsibleParam -obj $params -name "dns_domain_name"
$safe_mode_password= Get-AnsibleParam $param "safe_mode_password" $safe_mode_password= Get-AnsibleParam -obj $params -name "safe_mode_password"
$domain_admin_user = Get-AnsibleParam $param "domain_admin_user" -failifempty $result $domain_admin_user = Get-AnsibleParam -obj $params -name "domain_admin_user" -failifempty $result
$domain_admin_password= Get-AnsibleParam $param "domain_admin_password" -failifempty $result $domain_admin_password= Get-AnsibleParam -obj $params -name "domain_admin_password" -failifempty $result
$local_admin_password= Get-AnsibleParam $param "local_admin_password" $local_admin_password= Get-AnsibleParam -obj $params -name "local_admin_password"
$database_path = Get-AnsibleParam $param "database_path" -type "path" $database_path = Get-AnsibleParam -obj $params -name "database_path" -type "path"
$sysvol_path = Get-AnsibleParam $param "sysvol_path" -type "path" $sysvol_path = Get-AnsibleParam -obj $params -name "sysvol_path" -type "path"
$read_only = Get-AnsibleParam $param "read_only" -type "bool" -default $false $read_only = Get-AnsibleParam -obj $params -name "read_only" -type "bool" -default $false
$site_name = Get-AnsibleParam $param "site_name" -type "str" -failifempty $read_only $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 $state = Get-AnsibleParam -obj $params -name "state" -validateset ("domain_controller", "member_server") -failifempty $result
$log_path = Get-AnsibleParam $param "log_path" $log_path = Get-AnsibleParam -obj $params -name "log_path"
$_ansible_check_mode = Get-AnsibleParam $param "_ansible_check_mode" -default $false $_ansible_check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -default $false
$global:log_path = $log_path $global:log_path = $log_path

@ -58,12 +58,14 @@ options:
- The path to a directory on a fixed disk of the Windows host where the - The path to a directory on a fixed disk of the Windows host where the
domain database will be created.. domain database will be created..
- If not set then the default path is C(%SYSTEMROOT%\NTDS). - If not set then the default path is C(%SYSTEMROOT%\NTDS).
type: path
version_added: '2.5' version_added: '2.5'
sysvol_path: sysvol_path:
description: description:
- The path to a directory on a fixed disk of the Windows host where the - The path to a directory on a fixed disk of the Windows host where the
Sysvol folder will be created. Sysvol folder will be created.
- If not set then the default path is C(%SYSTEMROOT%\SYSVOL). - If not set then the default path is C(%SYSTEMROOT%\SYSVOL).
type: path
version_added: '2.5' version_added: '2.5'
author: author:
- Matt Davis (@nitzmahone) - Matt Davis (@nitzmahone)

@ -1,7 +1,6 @@
#!powershell #!powershell
# This file is part of Ansible
# (c) 2017, Jordan Borean <jborean93@gmail.com>, and others # Copyright: (c) 2017, Jordan Borean <jborean93@gmail.com>, and others
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#Requires -Module Ansible.ModuleUtils.Legacy #Requires -Module Ansible.ModuleUtils.Legacy
@ -10,7 +9,7 @@ $ErrorActionPreference = "Stop"
$params = Parse-Args -arguments $args -supports_check_mode $true $params = Parse-Args -arguments $args -supports_check_mode $true
$check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false $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 $name = Get-AnsibleParam -obj $params -name "name" -type "str" -failifempty $true
$display_name = Get-AnsibleParam -obj $params -name "display_name" -type "str" $display_name = Get-AnsibleParam -obj $params -name "display_name" -type "str"

@ -1,24 +1,9 @@
#!powershell #!powershell
# (c) 2017, Red Hat, Inc. # Copyright: (c) 2017, Red Hat, Inc.
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This file is part of Ansible
# #Requires -Module Ansible.ModuleUtils.Legacy
# 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 <http://www.gnu.org/licenses/>.
# WANT_JSON
# POWERSHELL_COMMON
Set-StrictMode -Version 2 Set-StrictMode -Version 2

@ -1,5 +1,4 @@
#!powershell #!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) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

@ -52,6 +52,7 @@ options:
Principal Group, set C(groups=<principal group name>) and Principal Group, set C(groups=<principal group name>) and
I(groups_action=replace). Note that users cannot be removed from I(groups_action=replace). Note that users cannot be removed from
their principal group (for example, "Domain Users"). their principal group (for example, "Domain Users").
type: list
groups_action: groups_action:
description: description:
- If C(add), the user is added to each group in I(groups) where not - If C(add), the user is added to each group in I(groups) where not

@ -1,8 +1,7 @@
#!powershell #!powershell
# This file is part of Ansible
# Copyright 2015, Peter Mounce <public@neverrunwithscissors.com> # Copyright: (c) 2015, Peter Mounce <public@neverrunwithscissors.com>
# 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) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#Requires -Module Ansible.ModuleUtils.Legacy #Requires -Module Ansible.ModuleUtils.Legacy

@ -1,8 +1,7 @@
#!powershell #!powershell
# This file is part of Ansible
# (c) 2015, Trond Hindenes <trond@hindenes.com>, and others # Copyright: (c) 2015, Trond Hindenes <trond@hindenes.com>, and others
# 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) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#Requires -Module Ansible.ModuleUtils.Legacy #Requires -Module Ansible.ModuleUtils.Legacy

@ -1,24 +1,9 @@
#!powershell #!powershell
# (c) 2017, Andrew Saraceni <andrew.saraceni@gmail.com> # Copyright: (c) 2017, Andrew Saraceni <andrew.saraceni@gmail.com>
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This file is part of Ansible
# #Requires -Module Ansible.ModuleUtils.Legacy
# 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 <http://www.gnu.org/licenses/>.
# WANT_JSON
# POWERSHELL_COMMON
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"

@ -38,15 +38,19 @@ options:
- A list of one or more sources to ensure are present/absent in the log. - 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, - When C(category_file), C(message_file) and/or C(parameter_file) are specified,
these values are applied across all sources. these values are applied across all sources.
type: list
category_file: category_file:
description: description:
- For one or more sources specified, the path to a custom category resource file. - For one or more sources specified, the path to a custom category resource file.
type: path
message_file: message_file:
description: description:
- For one or more sources specified, the path to a custom event message resource file. - For one or more sources specified, the path to a custom event message resource file.
type: path
parameter_file: parameter_file:
description: description:
- For one or more sources specified, the path to a custom parameter resource file. - For one or more sources specified, the path to a custom parameter resource file.
type: path
maximum_size: maximum_size:
description: description:
- The maximum size of the event log. - The maximum size of the event log.
@ -66,6 +70,7 @@ options:
description: description:
- The minimum number of days event entries must remain in the log. - The minimum number of days event entries must remain in the log.
- This option is only used when C(overflow_action) is C(OverwriteOlder). - This option is only used when C(overflow_action) is C(OverwriteOlder).
type: int
author: author:
- Andrew Saraceni (@andrewsaraceni) - Andrew Saraceni (@andrewsaraceni)
''' '''

@ -1,6 +1,6 @@
#!powershell #!powershell
# (c) 2017, Andrew Saraceni <andrew.saraceni@gmail.com> # Copyright: (c) 2017, Andrew Saraceni <andrew.saraceni@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#Requires -Module Ansible.ModuleUtils.Legacy #Requires -Module Ansible.ModuleUtils.Legacy

@ -1,7 +1,7 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# (c) 2017, Andrew Saraceni <andrew.saraceni@gmail.com> # Copyright: (c) 2017, Andrew Saraceni <andrew.saraceni@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1', ANSIBLE_METADATA = {'metadata_version': '1.1',
@ -29,6 +29,7 @@ options:
- The numeric event identifier for the entry. - The numeric event identifier for the entry.
- Value must be between 0 and 65535. - Value must be between 0 and 65535.
required: yes required: yes
type: int
message: message:
description: description:
- The message for the given log entry. - The message for the given log entry.
@ -45,6 +46,7 @@ options:
category: category:
description: description:
- A numeric task category associated with the category message file for the log source. - A numeric task category associated with the category message file for the log source.
type: int
raw_data: raw_data:
description: description:
- Binary data associated with the log entry. - Binary data associated with the log entry.

@ -1,5 +1,4 @@
#!powershell #!powershell
# This file is part of Ansible
# Copyright: (c) 2014, Paul Durivage <paul.durivage@rackspace.com> # Copyright: (c) 2014, Paul Durivage <paul.durivage@rackspace.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

@ -1,9 +1,8 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# This file is part of Ansible # Copyright: (c) 2014, Paul Durivage <paul.durivage@rackspace.com>
# Copyright: (c) 2014, Trond Hindenes <trond@hindenes.com>
# (c) 2014, Paul Durivage <paul.durivage@rackspace.com>, Trond Hindenes <trond@hindenes.com> and others
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # 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 # this is a windows documentation stub. actual code lives in the .ps1
@ -27,6 +26,7 @@ options:
description: description:
- Names of roles or features to install as a single feature or a comma-separated list of features. - Names of roles or features to install as a single feature or a comma-separated list of features.
required: yes required: yes
type: list
state: state:
description: description:
- State of the features or roles on the system. - State of the features or roles on the system.

@ -1,7 +1,6 @@
#!powershell #!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) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#Requires -Module Ansible.ModuleUtils.Legacy #Requires -Module Ansible.ModuleUtils.Legacy

@ -28,6 +28,7 @@ options:
description: description:
- Path to the file being managed. - Path to the file being managed.
required: yes required: yes
type: path
aliases: [ dest, name ] aliases: [ dest, name ]
state: state:
description: description:

@ -1,23 +1,9 @@
#!powershell #!powershell
#this file is part of Ansible # Copyright: (c) 2015, Sam Liu <sam.liu@activenetwork.com>
#Copyright © 2015 Sam Liu <sam.liu@activenetwork.com> # 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 #Requires -Module Ansible.ModuleUtils.Legacy
#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 <http://www.gnu.org/licenses/>.
# WANT_JSON
# POWERSHELL_COMMON
$params = Parse-Args $args -supports_check_mode $true $params = Parse-Args $args -supports_check_mode $true

@ -23,6 +23,7 @@ options:
- File to get version. - File to get version.
- Always provide absolute path. - Always provide absolute path.
required: yes required: yes
type: path
author: author:
- Sam Liu (@SamLiu79) - Sam Liu (@SamLiu79)
''' '''

@ -1,7 +1,6 @@
#!powershell #!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) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#Requires -Module Ansible.ModuleUtils.Legacy #Requires -Module Ansible.ModuleUtils.Legacy

@ -1,23 +1,9 @@
#!powershell #!powershell
# This file is part of Ansible
# Copyright: (c) 2017, Michael Eaton <meaton@iforium.com>
# Copyright 2017, Michael Eaton <meaton@iforium.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# Ansible is free software: you can redistribute it and/or modify #Requires -Module Ansible.ModuleUtils.Legacy
# 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 <http://www.gnu.org/licenses/>.
# WANT_JSON
# POWERSHELL_COMMON
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
$firewall_profiles = @('Domain', 'Private', 'Public') $firewall_profiles = @('Domain', 'Private', 'Public')

@ -22,6 +22,7 @@ options:
profiles: profiles:
description: description:
- Specify one or more profiles to change. - Specify one or more profiles to change.
type: list
choices: choices:
- Domain - Domain
- Private - Private

@ -1,10 +1,10 @@
#!powershell #!powershell
# Copyright (c) 2017 Artem Zinenko <zinenkoartem@gmail.com>
# Copyright (c) 2014 Timothy Vandenbrande <timothy.vandenbrande@gmail.com> # Copyright: (c) 2014, Timothy Vandenbrande <timothy.vandenbrande@gmail.com>
# Copyright: (c) 2017, Artem Zinenko <zinenkoartem@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# WANT_JSON #Requires -Module Ansible.ModuleUtils.Legacy
# POWERSHELL_COMMON
function Parse-ProtocolType { function Parse-ProtocolType {
param($protocol) param($protocol)

@ -75,6 +75,7 @@ options:
profiles: profiles:
description: description:
- The profile this rule applies to. - The profile this rule applies to.
type: list
default: domain,private,public default: domain,private,public
aliases: [ profile ] aliases: [ profile ]
force: force:

@ -1,7 +1,7 @@
#!powershell #!powershell
# This file is part of Ansible.
# # Copyright: (c) 2015, Paul Durivage <paul.durivage@rackspace.com>
# Copyright: (c) 2015, Paul Durivage <paul.durivage@rackspace.com>, Tal Auslander <tal@cloudshare.com> # Copyright: (c) 2015, Tal Auslander <tal@cloudshare.com>
# Copyright: (c) 2017, Dag Wieers <dag@wieers.com> # Copyright: (c) 2017, Dag Wieers <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

@ -33,6 +33,7 @@ options:
- The location to save the file at the URL. - The location to save the file at the URL.
- Be sure to include a filename and extension as appropriate. - Be sure to include a filename and extension as appropriate.
required: yes required: yes
type: path
force: force:
description: description:
- If C(yes), will always download the file. If C(no), will only - If C(yes), will always download the file. If C(no), will only
@ -47,6 +48,7 @@ options:
headers: headers:
description: description:
- Add custom HTTP headers to a request (as a dictionary). - Add custom HTTP headers to a request (as a dictionary).
type: dict
version_added: '2.4' version_added: '2.4'
url_username: url_username:
description: description:
@ -100,6 +102,7 @@ options:
timeout: timeout:
description: description:
- Timeout in seconds for URL request. - Timeout in seconds for URL request.
type: int
default: 10 default: 10
version_added : '2.4' version_added : '2.4'
''' '''

@ -1,23 +1,9 @@
#!powershell #!powershell
# This file is part of Ansible
#
# Copyright 2014, Chris Hoffman <choffman@chathamfinancial.com>
#
# 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 <http://www.gnu.org/licenses/>.
# WANT_JSON # Copyright: (c) 2014, Chris Hoffman <choffman@chathamfinancial.com>
# 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; $params = Parse-Args $args;
$check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false $check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false

@ -145,4 +145,4 @@ if ($final_members) {
$result.members = @() $result.members = @()
} }
Exit-Json -obj $result Exit-Json -obj $result

@ -30,6 +30,7 @@ options:
- Accepts all local, domain and service user types as username, - Accepts all local, domain and service user types as username,
favoring domain lookups when in a domain. favoring domain lookups when in a domain.
required: yes required: yes
type: list
state: state:
description: description:
- Desired state of the members in the group. - Desired state of the members in the group.

@ -1,4 +1,5 @@
#!powershell #!powershell
# Copyright: (c) 2018, Ripon Banik (@riponbanik) # Copyright: (c) 2018, Ripon Banik (@riponbanik)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

@ -1,7 +1,6 @@
#!powershell #!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) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#Requires -Module Ansible.ModuleUtils.Legacy #Requires -Module Ansible.ModuleUtils.Legacy

@ -46,6 +46,7 @@ options:
description: description:
- The path to the downloaded hotfix .msu file. - The path to the downloaded hotfix .msu file.
- This MUST be set if C(state=present) and MUST be a .msu hotfix file. - This MUST be set if C(state=present) and MUST be a .msu hotfix file.
type: path
notes: notes:
- This must be run on a host that has the DISM powershell module installed and - This must be run on a host that has the DISM powershell module installed and
a Powershell version >= 4. a Powershell version >= 4.

@ -1,25 +1,9 @@
#!powershell #!powershell
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Henrik Wallström <henrik@wallstroms.nu>
# (c) 2015, Henrik Wallström <henrik@wallstroms.nu> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# This file is part of Ansible #Requires -Module Ansible.ModuleUtils.Legacy
#
# 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 <http://www.gnu.org/licenses/>.
# WANT_JSON
# POWERSHELL_COMMON
$params = Parse-Args $args; $params = Parse-Args $args;

@ -1,24 +1,9 @@
#!powershell #!powershell
# (c) 2015, Henrik Wallström <henrik@wallstroms.nu> # Copyright: (c) 2015, Henrik Wallström <henrik@wallstroms.nu>
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This file is part of Ansible
# #Requires -Module Ansible.ModuleUtils.Legacy
# 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 <http://www.gnu.org/licenses/>.
# WANT_JSON
# POWERSHELL_COMMON
$params = Parse-Args $args -supports_check_mode $true $params = Parse-Args $args -supports_check_mode $true
$check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false $check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false

@ -1,24 +1,9 @@
#!powershell #!powershell
# (c) 2015, Henrik Wallström <henrik@wallstroms.nu> # Copyright: (c) 2015, Henrik Wallström <henrik@wallstroms.nu>
# # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This file is part of Ansible
# #Requires -Module Ansible.ModuleUtils.Legacy
# 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 <http://www.gnu.org/licenses/>.
# WANT_JSON
# POWERSHELL_COMMON
$params = Parse-Args $args; $params = Parse-Args $args;

@ -24,6 +24,7 @@ options:
- Note that the Windows path delimiter C(\) must be escaped as C(\\) when the line is double quoted. - 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). - Before 2.3 this option was only usable as I(dest), I(destfile) and I(name).
required: yes required: yes
type: path
aliases: [ dest, destfile, name ] aliases: [ dest, destfile, name ]
regexp: regexp:
description: description:

@ -1,7 +1,6 @@
#!powershell #!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) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#Requires -Module Ansible.ModuleUtils.Legacy #Requires -Module Ansible.ModuleUtils.Legacy

@ -43,6 +43,7 @@ options:
drive regardless of the target. drive regardless of the target.
- If C(state=absent) and the path is set, the module will throw an error if - 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. path does not match the target of the mapped drive.
type: path
state: state:
description: description:
- If C(present) will ensure the mapped drive exists. - If C(present) will ensure the mapped drive exists.

@ -1,24 +1,10 @@
#!powershell #!powershell
# This file is part of Ansible
#
# Copyright 2016, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk>
#
# 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 <http://www.gnu.org/licenses/>.
# WANT_JSON # Copyright: (c) 2016, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk>
# 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
#
$stopwatch = [system.diagnostics.stopwatch]::startNew() $stopwatch = [system.diagnostics.stopwatch]::startNew()
$params = Parse-Args $args -supports_check_mode $true $params = Parse-Args $args -supports_check_mode $true

@ -26,6 +26,7 @@ options:
display_seconds: display_seconds:
description: description:
- How long to wait for receiver to acknowledge message, in seconds. - How long to wait for receiver to acknowledge message, in seconds.
type: int
default: 10 default: 10
wait: wait:
description: description:

@ -1,27 +1,13 @@
#!powershell #!powershell
# This file is part of Ansible
#
# Copyright 2015, George Frank <george@georgefrank.net>
# Copyright 2015, Adam Keech <akeech@chathamfinancial.com>
# Copyright 2015, Hans-Joachim Kliemeck <git@kliemeck.de>
#
# 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 <http://www.gnu.org/licenses/>.
$ErrorActionPreference = "Stop" # Copyright: (c) 2015, George Frank <george@georgefrank.net>
# Copyright: (c) 2015, Adam Keech <akeech@chathamfinancial.com>
# Copyright: (c) 2015, Hans-Joachim Kliemeck <git@kliemeck.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#Requires -Module Ansible.ModuleUtils.Legacy
# WANT_JSON $ErrorActionPreference = "Stop"
# POWERSHELL_COMMON
$params = Parse-Args $args $params = Parse-Args $args

@ -1,5 +1,6 @@
#!powershell #!powershell
# Copyright 2015, Hans-Joachim Kliemeck <git@kliemeck.de>
# Copyright: (c) 2015, Hans-Joachim Kliemeck <git@kliemeck.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#Requires -Module Ansible.ModuleUtils.Legacy #Requires -Module Ansible.ModuleUtils.Legacy

@ -20,6 +20,7 @@ options:
description: description:
- Path to be used for changing owner - Path to be used for changing owner
required: yes required: yes
type: path
user: user:
description: description:
- Name to be used for changing owner - Name to be used for changing owner

@ -1,8 +1,7 @@
#!powershell #!powershell
# This file is part of Ansible
# (c) 2014, Trond Hindenes <trond@hindenes.com>, and others # Copyright: (c) 2014, Trond Hindenes <trond@hindenes.com>, and others
# 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) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#Requires -Module Ansible.ModuleUtils.Legacy #Requires -Module Ansible.ModuleUtils.Legacy

@ -37,6 +37,7 @@ options:
- Will check the existance of the path specified and use the result to - Will check the existance of the path specified and use the result to
determine whether the package is already installed. determine whether the package is already installed.
- You can use this in conjunction with C(product_id) and other C(creates_*). - You can use this in conjunction with C(product_id) and other C(creates_*).
type: path
version_added: '2.4' version_added: '2.4'
creates_service: creates_service:
description: description:
@ -59,6 +60,7 @@ options:
C(3010). C(3010).
- A return code of C(3010) usually means that a reboot is required, the - 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). C(reboot_required) return value is set if the return code is C(3010).
type: list
default: [0, 3010] default: [0, 3010]
password: password:
description: description:

@ -1,11 +1,9 @@
#!powershell #!powershell
# This file is part of Ansible
# # Copyright: (c) 2017, Liran Nisanov <lirannis@gmail.com>
# Copyright 2017, Liran Nisanov <lirannis@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# WANT_JSON #Requires -Module Ansible.ModuleUtils.Legacy
# POWERSHELL_COMMON
######## ########

@ -27,9 +27,11 @@ options:
initial_size: initial_size:
description: description:
- The initial size of the pagefile in megabytes. - The initial size of the pagefile in megabytes.
type: int
maximum_size: maximum_size:
description: description:
- The maximum size of the pagefile in megabytes. - The maximum size of the pagefile in megabytes.
type: int
override: override:
description: description:
- Override the current pagefile on the drive. - Override the current pagefile on the drive.

@ -1,21 +1,8 @@
#!powershell #!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)
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by #Requires -Module Ansible.ModuleUtils.Legacy
# 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 <http://www.gnu.org/licenses/>.
# WANT_JSON
# POWERSHELL_COMMON
Set-StrictMode -Version 2 Set-StrictMode -Version 2
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"

@ -1,10 +1,8 @@
#!powershell #!powershell
# This file is part of Ansible
# Copyright: (c) 2017, Erwan Quelin (@equelin) <erwan.quelin@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # 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 #Requires -Module Ansible.ModuleUtils.Legacy
$ErrorActionPreference = 'Stop' $ErrorActionPreference = 'Stop'
@ -15,8 +13,8 @@ $diff_mode = Get-AnsibleParam -obj $params -name "_ansible_diff" -type "bool" -d
# Modules parameters # Modules parameters
$path = Get-AnsibleParam -obj $params -name "path" -type "string" -failifempty $true $path = Get-AnsibleParam -obj $params -name "path" -type "str" -failifempty $true
$minimum_version = Get-AnsibleParam -obj $params -name "minimum_version" -type "string" -failifempty $false $minimum_version = Get-AnsibleParam -obj $params -name "minimum_version" -type "str" -failifempty $false
$result = @{ $result = @{
changed = $false changed = $false
@ -102,4 +100,4 @@ If (Test-Path -LiteralPath $path -PathType Leaf) {
$result.changed = $true $result.changed = $true
Exit-Json -obj $result Exit-Json -obj $result

@ -1,21 +1,8 @@
#!powershell #!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)
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by #Requires -Module Ansible.ModuleUtils.Legacy
# 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 <http://www.gnu.org/licenses/>.
# WANT_JSON
# POWERSHELL_COMMON
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"

@ -1,6 +1,6 @@
#!powershell #!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) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#Requires -Module Ansible.ModuleUtils.Legacy #Requires -Module Ansible.ModuleUtils.Legacy

@ -1,5 +1,4 @@
#!powershell #!powershell
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Dag Wieers (dagwieers) <dag@wieers.com> # Copyright: (c) 2017, Dag Wieers (dagwieers) <dag@wieers.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

@ -24,11 +24,13 @@ options:
executable: executable:
description: description:
- The location of the PsExec utility (in case it is not located in your PATH). - The location of the PsExec utility (in case it is not located in your PATH).
type: path
default: psexec.exe default: psexec.exe
hostnames: hostnames:
description: description:
- The hostnames to run the command. - The hostnames to run the command.
- If not provided, the command is run locally. - If not provided, the command is run locally.
type: list
username: username:
description: description:
- The (remote) user to run the command as. - The (remote) user to run the command as.
@ -40,6 +42,7 @@ options:
chdir: chdir:
description: description:
- Run the command from this (remote) directory. - Run the command from this (remote) directory.
type: path
nobanner: nobanner:
description: description:
- Do not display the startup banner and copyright message. - Do not display the startup banner and copyright message.
@ -85,6 +88,7 @@ options:
timeout: timeout:
description: description:
- The connection timeout in seconds - The connection timeout in seconds
type: int
wait: wait:
description: description:
- Wait for the application to terminate. - Wait for the application to terminate.

@ -1,33 +1,19 @@
#!powershell #!powershell
# This file is part of Ansible
# # Copyright: (c) 2017, Daniele Lazzari <lazzari@mailup.com>
# Copyright 2017, Daniele Lazzari <lazzari@mailup.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# Ansible is free software: you can redistribute it and/or modify #Requires -Module Ansible.ModuleUtils.Legacy
# 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 <http://www.gnu.org/licenses/>.
# WANT_JSON
# POWERSHELL_COMMON
# win_psmodule (Powershell modules Additions/Removal) # win_psmodule (Powershell modules Additions/Removal)
$params = Parse-Args $args -supports_check_mode $true $params = Parse-Args $args -supports_check_mode $true
$name = Get-AnsibleParam -obj $params "name" -type "str" -failifempty $true $name = Get-AnsibleParam -obj $params -name "name" -type "str" -failifempty $true
$repo = Get-AnsibleParam -obj $params "repository" -type "str" $repo = Get-AnsibleParam -obj $params -name "repository" -type "str"
$url = Get-AnsibleParam -obj $params "url" -type "str" $url = Get-AnsibleParam -obj $params -name "url" -type "str"
$state = Get-AnsibleParam -obj $params "state" -type "str" -default "present" -validateset "present", "absent" $state = Get-AnsibleParam -obj $params -name "state" -type "str" -default "present" -validateset "present", "absent"
$allow_clobber = Get-AnsibleParam -obj $params "allow_clobber" -type "bool" -default $false $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 $check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -default $false
$result = @{"changed" = $false $result = @{"changed" = $false

@ -1,9 +1,9 @@
#!powershell #!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) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# WANT_JSON #Requires -Module Ansible.ModuleUtils.Legacy
# POWERSHELL_COMMON
function Get-EnabledPlugins($rabbitmq_plugins_cmd) function Get-EnabledPlugins($rabbitmq_plugins_cmd)
{ {

@ -18,12 +18,14 @@ options:
pre_reboot_delay: pre_reboot_delay:
description: description:
- Seconds for shutdown to wait before requesting reboot - Seconds for shutdown to wait before requesting reboot
type: int
default: 2 default: 2
aliases: [ pre_reboot_delay_sec ] aliases: [ pre_reboot_delay_sec ]
post_reboot_delay: post_reboot_delay:
description: description:
- Seconds to wait after the reboot was successful and the connection was re-established - 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 - This is useful if you want wait for something to settle despite your connection already working
type: int
default: 0 default: 0
version_added: '2.4' version_added: '2.4'
aliases: [ post_reboot_delay_sec ] aliases: [ post_reboot_delay_sec ]
@ -32,17 +34,20 @@ options:
- Maximum seconds to wait for shutdown to occur - Maximum seconds to wait for shutdown to occur
- Increase this timeout for very slow hardware, large update applications, etc - 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 - This option has been removed since Ansible 2.5 as the win_reboot behavior has changed
type: int
default: 600 default: 600
aliases: [ shutdown_timeout_sec ] aliases: [ shutdown_timeout_sec ]
reboot_timeout: reboot_timeout:
description: description:
- Maximum seconds to wait for machine to re-appear on the network and respond to a test command - 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) - 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 default: 600
aliases: [ reboot_timeout_sec ] aliases: [ reboot_timeout_sec ]
connect_timeout: connect_timeout:
description: description:
- Maximum seconds to wait for a single successful TCP connection to the WinRM endpoint before trying again - Maximum seconds to wait for a single successful TCP connection to the WinRM endpoint before trying again
type: int
default: 5 default: 5
aliases: [ connect_timeout_sec ] aliases: [ connect_timeout_sec ]
test_command: test_command:

@ -1,21 +1,8 @@
#!powershell #!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)
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by #Requires -Module Ansible.ModuleUtils.Legacy
# 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 <http://www.gnu.org/licenses/>.
# WANT_JSON
# POWERSHELL_COMMON
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"

@ -1,8 +1,8 @@
#!powershell #!powershell
# This file is part of Ansible
# (c) 2015, Adam Keech <akeech@chathamfinancial.com>, Josh Ludwig <jludwig@chathamfinancial.com> # Copyright: (c) 2015, Adam Keech <akeech@chathamfinancial.com>
# (c) 2017, Jordan Borean <jborean93@gmail.com> # Copyright: (c) 2015, Josh Ludwig <jludwig@chathamfinancial.com>
# Copyright: (c) 2017, Jordan Borean <jborean93@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#Requires -Module Ansible.ModuleUtils.Legacy #Requires -Module Ansible.ModuleUtils.Legacy

@ -1,7 +1,8 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright: (c) 2015, Adam Keech <akeech@chathamfinancial.com>, Josh Ludwig <jludwig@chathamfinancial.com> # Copyright: (c) 2015, Adam Keech <akeech@chathamfinancial.com>
# Copyright: (c) 2015, Josh Ludwig <jludwig@chathamfinancial.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # 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 # this is a windows documentation stub. actual code lives in the .ps1
@ -79,6 +80,7 @@ options:
other hive saved as a file. other hive saved as a file.
- Using this function requires the user to have the C(SeRestorePrivilege) - Using this function requires the user to have the C(SeRestorePrivilege)
and C(SeBackupPrivilege) privileges enabled. and C(SeBackupPrivilege) privileges enabled.
type: path
version_added: '2.5' version_added: '2.5'
notes: 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 - 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

@ -1,21 +1,8 @@
#!powershell #!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)
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by #Requires -Module Ansible.ModuleUtils.Legacy
# 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 <http://www.gnu.org/licenses/>.
# WANT_JSON
# POWERSHELL_COMMON
$params = Parse-Args -arguments $args -supports_check_mode $true $params = Parse-Args -arguments $args -supports_check_mode $true
$check_mode = Get-AnsibleParam -obj $params "_ansible_check_mode" -type 'bool' -default $false $check_mode = Get-AnsibleParam -obj $params "_ansible_check_mode" -type 'bool' -default $false

@ -1,23 +1,9 @@
#!powershell #!powershell
# This file is part of Ansible
# # Copyright: (c) 2015, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk>
# Copyright 2015, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# Ansible is free software: you can redistribute it and/or modify #Requires -Module Ansible.ModuleUtils.Legacy
# 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 <http://www.gnu.org/licenses/>.
# WANT_JSON
# POWERSHELL_COMMON
Function Convert-RegistryPath { Function Convert-RegistryPath {
Param ( Param (

@ -29,6 +29,7 @@ options:
description: description:
- The full path including file name to the registry file on the remote machine to be merged - The full path including file name to the registry file on the remote machine to be merged
required: yes required: yes
type: path
compare_key: compare_key:
description: 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. - 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.

@ -1,10 +1,9 @@
#!powershell #!powershell
#
# Copyright 2015, Corwin Brown <corwin.brown@maxpoint.com> # Copyright: (c) 2015, Corwin Brown <corwin.brown@maxpoint.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# WANT_JSON #Requires -Module Ansible.ModuleUtils.Legacy
# POWERSHELL_COMMON
$params = Parse-Args $args -supports_check_mode $true $params = Parse-Args $args -supports_check_mode $true
$check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false $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 $dest = Get-AnsibleParam -obj $params -name "dest" -type "path" -failifempty $true
$purge = Get-AnsibleParam -obj $params -name "purge" -type "bool" -default $false $purge = Get-AnsibleParam -obj $params -name "purge" -type "bool" -default $false
$recurse = Get-AnsibleParam -obj $params -name "recurse" -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 = @{ $result = @{
changed = $false changed = $false

@ -25,10 +25,12 @@ options:
description: description:
- Source file/directory to sync. - Source file/directory to sync.
required: yes required: yes
type: path
dest: dest:
description: description:
- Destination file/directory to sync (Will receive contents of src). - Destination file/directory to sync (Will receive contents of src).
required: yes required: yes
type: path
recurse: recurse:
description: description:
- Includes all subdirectories (Toggles the C(/e) flag to RoboCopy). - Includes all subdirectories (Toggles the C(/e) flag to RoboCopy).

@ -1,23 +1,9 @@
#!powershell #!powershell
# This file is part of Ansible
# # Copyright: (c) 2016, Daniele Lazzari <lazzari@mailup.com>
# Copyright 2016, Daniele Lazzari <lazzari@mailup.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# Ansible is free software: you can redistribute it and/or modify #Requires -Module Ansible.ModuleUtils.Legacy
# 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 <http://www.gnu.org/licenses/>.
# WANT_JSON
# POWERSHELL_COMMON
# win_route (Add or remove a network static route) # win_route (Add or remove a network static route)
@ -115,4 +101,4 @@ else {
} }
Exit-Json $result Exit-Json $result

@ -30,6 +30,7 @@ options:
metric: metric:
description: description:
- Metric used by the static route. - Metric used by the static route.
type: int
default: 1 default: 1
state: state:
description: description:

@ -1,23 +1,9 @@
#!powershell #!powershell
# This file is part of Ansible
# # Copyright: (c) 2016, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk>
# Copyright 2016, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# Ansible is free software: you can redistribute it and/or modify #Requires -Module Ansible.ModuleUtils.Legacy
# 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 <http://www.gnu.org/licenses/>.
# WANT_JSON
# POWERSHELL_COMMON
$params = Parse-Args $args -supports_check_mode $true $params = Parse-Args $args -supports_check_mode $true
$check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false $check_mode = Get-AnsibleParam -obj $params -name "_ansible_check_mode" -type "bool" -default $false

@ -30,6 +30,7 @@ options:
- Full path to a windows format text file containing the text to be spokend. - Full path to a windows format text file containing the text to be spokend.
- Use either C(msg) or C(msg_file). - Use either C(msg) or C(msg_file).
- Optional so that you can use this module just to play sounds. - Optional so that you can use this module just to play sounds.
type: path
voice: voice:
description: description:
- Which voice to use. See notes for how to discover installed voices. - 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. - How fast or slow to speak the text.
- Must be an integer value in the range -10 to 10. - Must be an integer value in the range -10 to 10.
- -10 is slowest, 10 is fastest. - -10 is slowest, 10 is fastest.
type: int
default: 0 default: 0
start_sound_path: start_sound_path:
description: description:
- Full path to a C(.wav) file containing a sound to play before the text is spoken. - 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. - Useful on conference calls to alert other speakers that ansible has something to say.
type: path
end_sound_path: end_sound_path:
description: description:
- Full path to a C(.wav) file containing a sound to play after the text has been spoken. - 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. - Useful on conference calls to alert other speakers that ansible has finished speaking.
type: path
author: author:
- Jon Hawkesworth (@jhawkesworth) - Jon Hawkesworth (@jhawkesworth)
notes: notes:

@ -1,9 +1,8 @@
#!powershell #!powershell
# This file is part of Ansible
# Copyright 2015, Peter Mounce <public@neverrunwithscissors.com> # Copyright: (c) 2015, Peter Mounce <public@neverrunwithscissors.com>
# Michael Perzel <michaelperzel@gmail.com> # Copyright: (c) 2015, Michael Perzel <michaelperzel@gmail.com>
# 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) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#Requires -Module Ansible.ModuleUtils.Legacy #Requires -Module Ansible.ModuleUtils.Legacy

@ -53,6 +53,7 @@ options:
is kept when modifying the task. is kept when modifying the task.
- This module only supports the C(ExecAction) type but can still delete the - This module only supports the C(ExecAction) type but can still delete the
older legacy types. older legacy types.
type: list
suboptions: suboptions:
path: path:
description: description:
@ -78,6 +79,7 @@ options:
- DEPRECATED since 2.5, use the C(actions) option instead to specify a list - DEPRECATED since 2.5, use the C(actions) option instead to specify a list
of actions to run. of actions to run.
- Will be removed in 2.7. - Will be removed in 2.7.
type: path
# Trigger options # Trigger options
triggers: triggers:
@ -90,6 +92,7 @@ options:
for a list of trigger types and their options. for a list of trigger types and their options.
- The suboption options listed below are not required for all trigger - The suboption options listed below are not required for all trigger
types, read the description for more details. types, read the description for more details.
type: list
suboptions: suboptions:
type: type:
description: description:
@ -209,6 +212,7 @@ options:
- DEPRECATED since 2.5, use the C(triggers) option list with the type of - DEPRECATED since 2.5, use the C(triggers) option list with the type of
C(monthlydow) or C(weekly). C(monthlydow) or C(weekly).
- Will be removed in 2.7. - Will be removed in 2.7.
type: list
frequency: frequency:
description: description:
- The frequency of the task to run. - The frequency of the task to run.
@ -330,6 +334,7 @@ options:
- C(0) means the task is compatible with the AT command. - C(0) means the task is compatible with the AT command.
- C(1) means the task is compatible with Task Scheduler 1.0. - C(1) means the task is compatible with Task Scheduler 1.0.
- C(2) means the task is compatible with Task Scheduler 2.0. - C(2) means the task is compatible with Task Scheduler 2.0.
type: int
choices: [ 0, 1, 2 ] choices: [ 0, 1, 2 ]
version_added: '2.5' version_added: '2.5'
delete_expired_task_after: delete_expired_task_after:
@ -372,6 +377,7 @@ options:
before starting itself. before starting itself.
- C(2) will not start a new instance if another is running. - 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. - C(3) will stop other instances of the task and start the new one.
type: int
choices: [ 0, 1, 2, 3 ] choices: [ 0, 1, 2, 3 ]
version_added: '2.5' version_added: '2.5'
priority: priority:
@ -380,11 +386,13 @@ options:
- When creating a new task the default if C(7). - When creating a new task the default if C(7).
- See U(https://msdn.microsoft.com/en-us/library/windows/desktop/aa383512.aspx) - See U(https://msdn.microsoft.com/en-us/library/windows/desktop/aa383512.aspx)
for details on the priority levels. for details on the priority levels.
type: int
version_added: '2.5' version_added: '2.5'
restart_count: restart_count:
description: description:
- The number of times that the Task Scheduler will attempt to restart the - The number of times that the Task Scheduler will attempt to restart the
task. task.
type: int
version_added: '2.5' version_added: '2.5'
restart_interval: restart_interval:
description: description:

@ -1,6 +1,6 @@
#!powershell #!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) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#Requires -Module Ansible.ModuleUtils.CamelConversion #Requires -Module Ansible.ModuleUtils.CamelConversion

@ -1,23 +1,9 @@
#!powershell #!powershell
# This file is part of Ansible
# # Copyright: (c) 2017, Jordan Borean <jborean93@gmail.com>
# Copyright 2017, Jordan Borean <jborean93@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# Ansible is free software: you can redistribute it and/or modify #Requires -Module Ansible.ModuleUtils.Legacy
# 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 <http://www.gnu.org/licenses/>.
# WANT_JSON
# POWERSHELL_COMMON
$ErrorActionPreference = 'Stop' $ErrorActionPreference = 'Stop'

@ -1,7 +1,6 @@
#!powershell #!powershell
# This file is part of Ansible
# Copyright 2014, Chris Hoffman <choffman@chathamfinancial.com> # Copyright: (c) 2014, Chris Hoffman <choffman@chathamfinancial.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#Requires -Module Ansible.ModuleUtils.Legacy #Requires -Module Ansible.ModuleUtils.Legacy

@ -24,6 +24,7 @@ options:
service. service.
- This works by C(dependency_action) to either add/remove or set the - This works by C(dependency_action) to either add/remove or set the
services in this list. services in this list.
type: list
version_added: "2.3" version_added: "2.3"
dependency_action: dependency_action:
description: description:

@ -1,5 +1,6 @@
#!powershell #!powershell
# Copyright 2015, Hans-Joachim Kliemeck <git@kliemeck.de>
# Copyright: (c) 2015, Hans-Joachim Kliemeck <git@kliemeck.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#Requires -Module Ansible.ModuleUtils.Legacy #Requires -Module Ansible.ModuleUtils.Legacy

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save