New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
win_iis_webapplication: add authentication parameters #56033
Conversation
added version added to new options.
@@ -13,6 +13,9 @@ $site = Get-AnsibleParam -obj $params -name "site" -type "str" -failifempty $tru | |||
$state = Get-AnsibleParam -obj $params -name "state" -type "str" -default "present" -validateset "absent","present" | |||
$physical_path = Get-AnsibleParam -obj $params -name "physical_path" -type "str" -aliases "path" | |||
$application_pool = Get-AnsibleParam -obj $params -name "application_pool" -type "str" | |||
$connect_as = Get-AnsibleParam -obj $params -name 'connect_as' -type 'str' -validateset 'specific_user', 'pass_through' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add a default option of pass_through
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this were a new module, I would make that the default option, but there could be tasks out there using this module where they have changed the authentication to specific user a different way. Making a default value on this option would break that configuration.
Setting a default also wouldn't be consistent with the behavior of application_pool and physical_path, where they are only set if the user passes them as parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are absolutely right, missed that
Should add a changelog fragment and update the .py file for documentation |
@ShachafGoldstein I added the changelog fragment. The .py documentation was already updated to show the new options. |
close and open the PR to make it run the tests again |
Failed on 2012-R2 this time, same error message as before. |
Only thing I can think of is that the copy somehow damages the file. |
remove unused iis version check test checksum of iis configuration after backup
Adding some extra cleanup tasks before restoring the previous IIS configuration seemed to work. After looking closer I realized it was failing on the restore copy because IIS was still using the configuration file. Then the tests were run again in verbose mode, which is where we were seeing the failure in the website module. |
No idea why Server 2008R2 doesn't like when application_pool is null, I'll just skip it for now and run the tests on 2012 and higher. I'm guessing that it is something to do with the PowerShell version or web administration module version on the host. Maybe someone in the future will decide to make it work on 2008R2. My guess is that it's either because of the splatting of parameters done here: https://github.com/ansible/ansible/pull/56033/files#diff-bd862e2bbcb44c9c332df7b6cacf6adaR55 |
Thanks for the contribution and adding the tests as well. Apologies for the delay and thanks for sticking with it. |
* add connect_as, username, password parameters add tests * fixed reference to undefined variable. added version added to new options. * add changelog fragment * fix line endings * use ansible facts to determine os version remove unused iis version check test checksum of iis configuration after backup * correct assertion * added more cleanup tasks. * version added is now 2.10 * skip server 2008 r2 for now * run tests on server 2012 and higher
SUMMARY
When setting up an application in IIS, you can specify the authentication type as either Application User (pass-through authentication) or specific user with a username and password. This just adds the parameters to support that.
I also added tests since it didn't seem like this module had any integration tests yet.
Added the following parameters to win_iis_webapplication: connect_as, username, password.
ISSUE TYPE
COMPONENT NAME
win_iis_webapplication
ADDITIONAL INFORMATION
you can do something like this