From 5dd40349b259499b4ee85c587e37dddf8c2f9422 Mon Sep 17 00:00:00 2001 From: Jordan Borean Date: Fri, 15 Dec 2017 09:50:44 +1000 Subject: [PATCH] win_iis_webapppool: stop any passwords from being returned (#33931) (cherry picked from commit 0ca828ebab48b18a7c4bc1770efce96c6579b2df) --- lib/ansible/modules/windows/win_iis_webapppool.ps1 | 6 ++++-- test/integration/targets/win_iis_webapppool/tasks/tests.yml | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/ansible/modules/windows/win_iis_webapppool.ps1 b/lib/ansible/modules/windows/win_iis_webapppool.ps1 index d95ba80bbd..f8f26186cc 100644 --- a/lib/ansible/modules/windows/win_iis_webapppool.ps1 +++ b/lib/ansible/modules/windows/win_iis_webapppool.ps1 @@ -305,9 +305,11 @@ foreach ($element in $elements) { foreach ($attribute in $attribute_collection) { $attribute_name = $attribute.Name - $attribute_value = $attribute_parent.$attribute_name + if ($attribute_name -notlike "*password*") { + $attribute_value = $attribute_parent.$attribute_name - $result.info.$element.Add($attribute_name, $attribute_value) + $result.info.$element.Add($attribute_name, $attribute_value) + } } } diff --git a/test/integration/targets/win_iis_webapppool/tasks/tests.yml b/test/integration/targets/win_iis_webapppool/tasks/tests.yml index ab34d043c9..c26ed0804e 100644 --- a/test/integration/targets/win_iis_webapppool/tasks/tests.yml +++ b/test/integration/targets/win_iis_webapppool/tasks/tests.yml @@ -416,7 +416,7 @@ state: present attributes: startMode: AlwaysRunning - processModel.identityType: 3 + processModel.identityType: SpecificUser processModel.userName: '{{ansible_user}}' processModel.password: '{{ansible_password}}' register: iis_attributes_new_check @@ -434,7 +434,7 @@ state: present attributes: startMode: AlwaysRunning - processModel.identityType: 3 + processModel.identityType: SpecificUser processModel.userName: '{{ansible_user}}' processModel.password: '{{ansible_password}}' register: iis_attributes_new @@ -446,7 +446,6 @@ - iis_attributes_new.info.attributes.startMode == 'AlwaysRunning' - iis_attributes_new.info.processModel.identityType == 'SpecificUser' - iis_attributes_new.info.processModel.userName == ansible_user - - iis_attributes_new.info.processModel.password == ansible_password - name: change attributes for newer IIS version again win_iis_webapppool: