mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 22:33:25 +00:00
Validate EXAMPLES as YAML
This commit is contained in:
committed by
Toshio Kuratomi
parent
499d3a1b53
commit
7c00346714
@@ -129,6 +129,7 @@ EXAMPLES = r'''
|
||||
|
||||
# Remove previously added rule for IIS_IUSRS
|
||||
- name: Remove FullControl AccessRule for IIS_IUSRS
|
||||
win_acl:
|
||||
path: C:\inetpub\wwwroot\MySite
|
||||
user: IIS_IUSRS
|
||||
rights: FullControl
|
||||
@@ -139,6 +140,7 @@ EXAMPLES = r'''
|
||||
|
||||
# Deny Intern
|
||||
- name: Deny Deny
|
||||
win_acl:
|
||||
path: C:\Administrator\Documents
|
||||
user: Intern
|
||||
rights: Read,Write,Modify,FullControl,Delete
|
||||
|
||||
@@ -149,7 +149,7 @@ EXAMPLES = r'''
|
||||
# Find files in path based on regex pattern
|
||||
- win_find:
|
||||
paths: D:\temp
|
||||
patterns: "out_\d{8}-\d{6}.log"
|
||||
patterns: 'out_\d{8}-\d{6}.log'
|
||||
|
||||
# Find files older than 1 day
|
||||
- win_find:
|
||||
|
||||
@@ -104,20 +104,20 @@ EXAMPLES = r'''
|
||||
# Specify the expected non-zero return code when successful
|
||||
# In this case 3010 indicates 'reboot required'
|
||||
- name: 'Microsoft .NET Framework 4.5.1'
|
||||
win_package:
|
||||
path: https://download.microsoft.com/download/1/6/7/167F0D79-9317-48AE-AEDB-17120579F8E2/NDP451-KB2858728-x86-x64-AllOS-ENU.exe
|
||||
productid: '{7DEBE4EB-6B40-3766-BB35-5CBBC385DA37}'
|
||||
arguments: '/q /norestart'
|
||||
ensure: present
|
||||
expected_return_code: 3010
|
||||
win_package:
|
||||
path: https://download.microsoft.com/download/1/6/7/167F0D79-9317-48AE-AEDB-17120579F8E2/NDP451-KB2858728-x86-x64-AllOS-ENU.exe
|
||||
productid: '{7DEBE4EB-6B40-3766-BB35-5CBBC385DA37}'
|
||||
arguments: '/q /norestart'
|
||||
ensure: present
|
||||
expected_return_code: 3010
|
||||
|
||||
# Specify multiple non-zero return codes when successful
|
||||
# In this case we can say that both 0 (SUCCESSFUL) and 3010 (REBOOT REQUIRED) codes are acceptable
|
||||
- name: 'Microsoft .NET Framework 4.5.1'
|
||||
win_package:
|
||||
path: https://download.microsoft.com/download/1/6/7/167F0D79-9317-48AE-AEDB-17120579F8E2/NDP451-KB2858728-x86-x64-AllOS-ENU.exe
|
||||
productid: '{7DEBE4EB-6B40-3766-BB35-5CBBC385DA37}'
|
||||
arguments: '/q /norestart'
|
||||
ensure: present
|
||||
expected_return_code: [0,3010]
|
||||
- name: 'Microsoft .NET Framework 4.5.1'
|
||||
win_package:
|
||||
path: https://download.microsoft.com/download/1/6/7/167F0D79-9317-48AE-AEDB-17120579F8E2/NDP451-KB2858728-x86-x64-AllOS-ENU.exe
|
||||
productid: '{7DEBE4EB-6B40-3766-BB35-5CBBC385DA37}'
|
||||
arguments: '/q /norestart'
|
||||
ensure: present
|
||||
expected_return_code: [0,3010]
|
||||
'''
|
||||
|
||||
@@ -75,11 +75,11 @@ EXAMPLES = r'''
|
||||
- name: Ensure that system32 and Powershell are present on the global system path, and in the specified order
|
||||
win_path:
|
||||
elements:
|
||||
- %SystemRoot%\system32
|
||||
- %SystemRoot%\system32\WindowsPowerShell\v1.0
|
||||
- '%SystemRoot%\system32'
|
||||
- '%SystemRoot%\system32\WindowsPowerShell\v1.0'
|
||||
|
||||
- name: Ensure that C:\Program Files\MyJavaThing is not on the current user's CLASSPATH
|
||||
win_path
|
||||
win_path:
|
||||
name: CLASSPATH
|
||||
elements: C:\Program Files\MyJavaThing
|
||||
scope: user
|
||||
|
||||
@@ -42,7 +42,7 @@ author: "Chris Church (@cchurch)"
|
||||
|
||||
EXAMPLES = r'''
|
||||
# Test connectivity to a windows host
|
||||
ansible winserver -m win_ping
|
||||
# ansible winserver -m win_ping
|
||||
|
||||
# Example from an Ansible Playbook
|
||||
- win_ping:
|
||||
|
||||
@@ -89,7 +89,6 @@ EXAMPLES = r'''
|
||||
creates: C:\Users\Phil\OldLogs
|
||||
|
||||
# This playbook example unzips a .zip file and recursively decompresses the contained .gz files and removes all unneeded compressed files after completion.
|
||||
---
|
||||
- name: Unzip ApplicationLogs.zip and decompress all GZipped log files
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
@@ -102,15 +101,15 @@ EXAMPLES = r'''
|
||||
rm: true
|
||||
|
||||
# Install PSCX to use for extracting a gz file
|
||||
- name: Grab PSCX msi
|
||||
win_get_url:
|
||||
url: http://download-codeplex.sec.s-msft.com/Download/Release?ProjectName=pscx&DownloadId=923562&FileTime=130585918034470000&Build=20959
|
||||
dest: C:\pscx.msi
|
||||
- name: Install PSCX
|
||||
win_msi:
|
||||
path: C:\pscx.msi
|
||||
- name: Unzip gz log
|
||||
win_unzip:
|
||||
src: C:\Logs\application-error-logs.gz
|
||||
dest: C:\ExtractedLogs\application-error-logs
|
||||
- name: Grab PSCX msi
|
||||
win_get_url:
|
||||
url: http://download-codeplex.sec.s-msft.com/Download/Release?ProjectName=pscx&DownloadId=923562&FileTime=130585918034470000&Build=20959
|
||||
dest: C:\pscx.msi
|
||||
- name: Install PSCX
|
||||
win_msi:
|
||||
path: C:\pscx.msi
|
||||
- name: Unzip gz log
|
||||
win_unzip:
|
||||
src: C:\Logs\application-error-logs.gz
|
||||
dest: C:\ExtractedLogs\application-error-logs
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user