From c850bf15d076394ccebc0a3985c30bf028d9804f Mon Sep 17 00:00:00 2001 From: Fabio Alessandro Locati Date: Thu, 24 Aug 2017 17:14:05 +0200 Subject: [PATCH] windows/win_command: improve examples (#20465) * windows/win_command: improve examples * Improve description * Improvements * minor updates based on PR feedback --- lib/ansible/modules/windows/win_command.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/ansible/modules/windows/win_command.py b/lib/ansible/modules/windows/win_command.py index 655b5897101..793f5a0c237 100644 --- a/lib/ansible/modules/windows/win_command.py +++ b/lib/ansible/modules/windows/win_command.py @@ -64,17 +64,12 @@ author: ''' EXAMPLES = r''' -# Example from Ansible Playbooks. -- win_command: whoami +- name: Save the result of 'whoami' in 'whoami_out' + win_command: whoami register: whoami_out -# Run the command only if the specified file does not exist. -- win_command: wbadmin -backupTarget:C:\backup\ creates=C:\backup\ - -# You can also use the 'args' form to provide the options. This command -# will change the working directory to C:\somedir\\ and will only run when -# C:\backup\ doesn't exist. -- win_command: wbadmin -backupTarget:C:\backup\ creates=C:\backup\ +- name: Run command that only runs if folder exists and runs from a specific folder + win_command: wbadmin -backupTarget:C:\backup\ args: chdir: C:\somedir\ creates: C:\backup\