From 6d792838e49103bef076d5c4807e92a2cfc71015 Mon Sep 17 00:00:00 2001 From: Jordan Borean Date: Tue, 4 Feb 2020 10:43:33 +1000 Subject: [PATCH] Move url option from util to individual modules (#67068) --- .../powershell/Ansible.ModuleUtils.WebRequest.psm1 | 1 - lib/ansible/modules/windows/win_get_url.ps1 | 1 + lib/ansible/modules/windows/win_uri.ps1 | 3 ++- lib/ansible/plugins/doc_fragments/url_windows.py | 5 ----- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/ansible/module_utils/powershell/Ansible.ModuleUtils.WebRequest.psm1 b/lib/ansible/module_utils/powershell/Ansible.ModuleUtils.WebRequest.psm1 index 456365102b3..fffb5f47834 100644 --- a/lib/ansible/module_utils/powershell/Ansible.ModuleUtils.WebRequest.psm1 +++ b/lib/ansible/module_utils/powershell/Ansible.ModuleUtils.WebRequest.psm1 @@ -519,7 +519,6 @@ Function Merge-WebRequestSpec { } $ansible_web_request_options = @{ - url = @{ type="str"; required=$true } method = @{ type="str" } follow_redirects = @{ type="str"; choices=@("all","none","safe"); default="safe" } headers = @{ type="dict" } diff --git a/lib/ansible/modules/windows/win_get_url.ps1 b/lib/ansible/modules/windows/win_get_url.ps1 index b4630566313..a4c6e13d326 100644 --- a/lib/ansible/modules/windows/win_get_url.ps1 +++ b/lib/ansible/modules/windows/win_get_url.ps1 @@ -13,6 +13,7 @@ $spec = @{ options = @{ + url = @{ type="str"; required=$true } dest = @{ type='path'; required=$true } force = @{ type='bool'; default=$true } checksum = @{ type='str' } diff --git a/lib/ansible/modules/windows/win_uri.ps1 b/lib/ansible/modules/windows/win_uri.ps1 index a84d7ed8d8d..09ccf1b0b32 100644 --- a/lib/ansible/modules/windows/win_uri.ps1 +++ b/lib/ansible/modules/windows/win_uri.ps1 @@ -12,6 +12,7 @@ $spec = @{ options = @{ + url = @{ type = "str"; required = $true } content_type = @{ type = "str" } body = @{ type = "raw" } dest = @{ type = "path" } @@ -73,7 +74,7 @@ if ($removes -and -not (Test-AnsiblePath -Path $removes)) { $module.ExitJson() } -$client = Get-AnsibleWebRequest -Module $module +$client = Get-AnsibleWebRequest -Uri $url -Module $module if ($null -ne $content_type) { $client.ContentType = $content_type diff --git a/lib/ansible/plugins/doc_fragments/url_windows.py b/lib/ansible/plugins/doc_fragments/url_windows.py index 1076045ae1c..29a5be311f9 100644 --- a/lib/ansible/plugins/doc_fragments/url_windows.py +++ b/lib/ansible/plugins/doc_fragments/url_windows.py @@ -12,11 +12,6 @@ class ModuleDocFragment(object): # Standard files documentation fragment DOCUMENTATION = r''' options: - url: - description: - - The URL to make the request with. - required: yes - type: str method: description: - The HTTP Method of the request.