From d11a5bd492644dbddebd0f607922a4db78a5d7c5 Mon Sep 17 00:00:00 2001 From: Fabio Alessandro Locati Date: Thu, 1 Dec 2016 17:39:49 +0000 Subject: [PATCH] Native YAML - windows (#3602) * Native YAML - windows * Fix baskslash * Sorry --- .../extras/windows/win_file_version.py | 3 ++- .../extras/windows/win_scheduled_task.py | 13 ++++++++++-- .../modules/extras/windows/win_updates.py | 21 ++++++++++++------- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/lib/ansible/modules/extras/windows/win_file_version.py b/lib/ansible/modules/extras/windows/win_file_version.py index 4f2ecc0d61..71aae57135 100644 --- a/lib/ansible/modules/extras/windows/win_file_version.py +++ b/lib/ansible/modules/extras/windows/win_file_version.py @@ -42,7 +42,8 @@ EXAMPLES = ''' path: 'C:\Windows\System32\cmd.exe' register: exe_file_version -- debug: msg="{{exe_file_version}}" +- debug: + msg: '{{ exe_file_version }}' ''' diff --git a/lib/ansible/modules/extras/windows/win_scheduled_task.py b/lib/ansible/modules/extras/windows/win_scheduled_task.py index a51874a30c..a4acd06754 100644 --- a/lib/ansible/modules/extras/windows/win_scheduled_task.py +++ b/lib/ansible/modules/extras/windows/win_scheduled_task.py @@ -74,6 +74,15 @@ options: ''' EXAMPLES = ''' - # Create a scheduled task to open a command prompt - win_scheduled_task: name="TaskName" execute="cmd" frequency="daily" time="9am" description="open command prompt" path="example" enable=yes state=present +# Create a scheduled task to open a command prompt +- win_scheduled_task: + name: TaskName + execute: cmd + frequency: daily + time: 9am + description: open command prompt + path: example + enable: yes + state: present + user: SYSTEM ''' diff --git a/lib/ansible/modules/extras/windows/win_updates.py b/lib/ansible/modules/extras/windows/win_updates.py index efdd1146ad..8700126c18 100644 --- a/lib/ansible/modules/extras/windows/win_updates.py +++ b/lib/ansible/modules/extras/windows/win_updates.py @@ -69,15 +69,22 @@ notes: ''' EXAMPLES = ''' - # Install all security, critical, and rollup updates - win_updates: - category_names: ['SecurityUpdates','CriticalUpdates','UpdateRollups'] +# Install all security, critical, and rollup updates +- win_updates: + category_names: + - SecurityUpdates + - CriticalUpdates + - UpdateRollups - # Install only security updates - win_updates: category_names=SecurityUpdates +# Install only security updates +- win_updates: + category_names: SecurityUpdates - # Search-only, return list of found updates (if any), log to c:\ansible_wu.txt - win_updates: category_names=SecurityUpdates state=searched log_path=c:/ansible_wu.txt +# Search-only, return list of found updates (if any), log to c:\ansible_wu.txt +- win_updates: + category_names: SecurityUpdates + state: searched + log_path: c:\ansible_wu.txt ''' RETURN = '''