Skip to content

Commit

Permalink
Migrate win_iis_webapplication module to new microsoft.iis repository
Browse files Browse the repository at this point in the history
  • Loading branch information
ronger4 committed Dec 31, 2024
2 parents fa6cdff + f823bb6 commit 4449bb9
Show file tree
Hide file tree
Showing 5 changed files with 474 additions and 4 deletions.
9 changes: 5 additions & 4 deletions plugins/modules/web_application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ DOCUMENTATION:
- If C(pass_through), IIS will use the identity of the user or application pool identity to access the file system or network.
- If C(specific_user), IIS will use the credentials provided in I(username) and I(password) to access the file system or network.
type: str
default: pass_through
choices:
- pass_through
- specific_user
Expand All @@ -58,10 +59,10 @@ DOCUMENTATION:
- Required when I(connect_as) is set to C(specific_user).
type: str
seealso:
- module: microsoft.iis.win_iis_virtualdirectory
- module: microsoft.iis.win_iis_webapppool
- module: microsoft.iis.win_iis_webbinding
- module: microsoft.iis.win_iis_website
- module: community.windows.win_iis_virtualdirectory
- module: community.windows.win_iis_webapppool
- module: community.windows.win_iis_webbinding
- module: community.windows.win_iis_website
author:
- Henrik Wallström (@henrikwallstrom)

Expand Down
1 change: 1 addition & 0 deletions tests/integration/targets/win_iis_webapppool/aliases
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shippable/windows/group3
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test_iis_webapppool_name: TestPool
43 changes: 43 additions & 0 deletions tests/integration/targets/win_iis_webapppool/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
# Cannot use win_feature to install IIS on Server 2008.
# Run a brief check and skip hosts that don't support
# that operation
- name: check if win_feature will work on test host
ansible.windows.win_command: powershell.exe "Get-WindowsFeature"
register: module_available
failed_when: False

# Run actual tests
- block:
- name: ensure IIS features are installed
ansible.windows.win_feature:
name: Web-Server
state: present
include_management_tools: True
register: feature_install

- name: reboot after feature install
ansible.windows.win_reboot:
when: feature_install.reboot_required

- name: set version of IIS for tests
win_file_version:
path: C:\Windows\System32\inetsrv\w3wp.exe
register: iis_version

- name: ensure test pool is deleted as a baseline
win_iis_webapppool:
name: '{{test_iis_webapppool_name}}'
state: absent

# Tests
- name: run tests on hosts that support it
include_tasks: tests.yml

always:
# Cleanup
- name: ensure test pool is deleted
win_iis_webapppool:
name: '{{test_iis_webapppool_name}}'
state: absent
when: module_available.rc == 0
Loading

0 comments on commit 4449bb9

Please sign in to comment.