mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
4fe08441be
* Warn on tests used as filters * Update docs, add aliases for tests that fit more gramatically with test syntax * Fix rst formatting * Add successful filter, alias of success * Remove renamed_deprecation, it was overkill * Make directory alias for is_dir * Update tests to use proper jinja test syntax * Update additional documentation, living outside of YAML files, to reflect proper jinja test syntax * Add conversion script, porting guide updates, and changelog updates * Update newly added uses of tests as filters * No underscore variable * Convert recent tests as filter changes to win_stat * Fix some changes related to rebasing a few integration tests * Make tests_as_filters_warning explicitly accept the name of the test, instead of inferring the name * Add test for tests_as_filters_warning * Update tests as filters in newly added/modified tests * Address recent changes to several integration tests * Address recent changes in cs_vpc
135 lines
3.6 KiB
YAML
135 lines
3.6 KiB
YAML
# these tests are destructive and can be run manually on a throwaway host
|
|
# set test_win_dsc_run_desctructive: yes in default/main.yml
|
|
---
|
|
- name: ensure IIS features are installed
|
|
win_feature:
|
|
name: Web-Server
|
|
include_sub_features: yes
|
|
include_management_tools: no
|
|
state: present
|
|
|
|
- name: install xWebAdministration module
|
|
win_psmodule:
|
|
name: xWebAdministration
|
|
state: present
|
|
|
|
- name: ensure IIS website does not exists
|
|
win_iis_website:
|
|
name: Ansible DSC Test
|
|
state: absent
|
|
|
|
- name: get certificate hash for IIS test
|
|
win_shell: (Get-ChildItem -Path Cert:\LocalMachine\My)[0].Thumbprint
|
|
register: win_dsc_cert_thumbprint
|
|
|
|
- name: create an IIS website with auth and binding info (check mode)
|
|
win_dsc:
|
|
resource_name: xWebSite
|
|
Ensure: Present
|
|
Name: Ansible DSC Test
|
|
State: Started
|
|
PhysicalPath: C:\inetpub\wwwroot
|
|
BindingInfo:
|
|
- Protocol: https
|
|
Port: 8443
|
|
CertificateStoreName: MY
|
|
CertificateThumbprint: '{{win_dsc_cert_thumbprint.stdout_lines[0]}}'
|
|
HostName: DSCTest
|
|
IPAddress: '*'
|
|
SSLFlags: '1'
|
|
- Protocol: http
|
|
Port: 8888
|
|
IPAddress: '*'
|
|
AuthenticationInfo:
|
|
Anonymous: yes
|
|
Basic: no
|
|
Digest: no
|
|
Windows: yes
|
|
register: win_dsc_iis_check
|
|
check_mode: yes
|
|
|
|
- name: get result of create an IIS website (check mode)
|
|
test_win_dsc_iis_info:
|
|
name: Ansible DSC Test
|
|
register: win_dsc_iis_check_result
|
|
|
|
- name: assert results of create an IIS website (check mode)
|
|
assert:
|
|
that:
|
|
- win_dsc_iis_check is changed
|
|
- win_dsc_iis_check_result.exists == False
|
|
|
|
- name: create an IIS website with auth and binding info
|
|
win_dsc:
|
|
resource_name: xWebSite
|
|
Ensure: Present
|
|
Name: Ansible DSC Test
|
|
State: Started
|
|
PhysicalPath: C:\inetpub\wwwroot
|
|
BindingInfo:
|
|
- Protocol: https
|
|
Port: 8443
|
|
CertificateStoreName: MY
|
|
CertificateThumbprint: '{{win_dsc_cert_thumbprint.stdout_lines[0]}}'
|
|
HostName: Test
|
|
IPAddress: '*'
|
|
SSLFlags: '1'
|
|
- Protocol: http
|
|
Port: 8888
|
|
IPAddress: '*'
|
|
AuthenticationInfo:
|
|
Anonymous: yes
|
|
Basic: no
|
|
Digest: no
|
|
Windows: yes
|
|
register: win_dsc_iis
|
|
|
|
- name: get result of create an IIS website
|
|
test_win_dsc_iis_info:
|
|
name: Ansible DSC Test
|
|
register: win_dsc_iis_result
|
|
|
|
- name: assert results of create an IIS website
|
|
assert:
|
|
that:
|
|
- win_dsc_iis is changed
|
|
- win_dsc_iis_result.exists == True
|
|
- win_dsc_iis_result.auth.anonymous == True
|
|
- win_dsc_iis_result.auth.basic == False
|
|
- win_dsc_iis_result.auth.digest == False
|
|
- win_dsc_iis_result.auth.windows == True
|
|
- win_dsc_iis_result.http.binding == "*:8888:"
|
|
- win_dsc_iis_result.https.binding == "*:8443:Test"
|
|
- win_dsc_iis_result.https.hash == '{{win_dsc_cert_thumbprint.stdout_lines[0]}}'
|
|
- win_dsc_iis_result.https.sslFlags == 1
|
|
- win_dsc_iis_result.https.store == "MY"
|
|
|
|
- name: create an IIS website with auth and binding info (idempotent)
|
|
win_dsc:
|
|
resource_name: xWebSite
|
|
Ensure: Present
|
|
Name: Ansible DSC Test
|
|
State: Started
|
|
PhysicalPath: C:\inetpub\wwwroot
|
|
BindingInfo:
|
|
- Protocol: https
|
|
Port: 8443
|
|
CertificateStoreName: MY
|
|
CertificateThumbprint: '{{win_dsc_cert_thumbprint.stdout_lines[0]}}'
|
|
HostName: Test
|
|
IPAddress: '*'
|
|
SSLFlags: '1'
|
|
- Protocol: http
|
|
Port: 8888
|
|
IPAddress: '*'
|
|
AuthenticationInfo:
|
|
Anonymous: yes
|
|
Basic: no
|
|
Digest: no
|
|
Windows: yes
|
|
register: win_dsc_iis_again
|
|
|
|
- name: assert results of create an IIS website (idempotent)
|
|
assert:
|
|
that:
|
|
- win_dsc_iis_again is not changed
|