From fb0779f6574b21ac374c090c90e4664e51ebd99f Mon Sep 17 00:00:00 2001 From: Fabio Alessandro Locati Date: Fri, 16 Dec 2016 00:05:18 +0100 Subject: [PATCH] Improve YAML examples - windows/win_regedit.py (#19400) --- lib/ansible/modules/windows/win_regedit.py | 35 +++++++--------------- 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/lib/ansible/modules/windows/win_regedit.py b/lib/ansible/modules/windows/win_regedit.py index 693b4c2f37..a7815b2052 100644 --- a/lib/ansible/modules/windows/win_regedit.py +++ b/lib/ansible/modules/windows/win_regedit.py @@ -76,67 +76,54 @@ options: author: "Adam Keech (@smadam813), Josh Ludwig (@joshludwig)" ''' -EXAMPLES = ''' - # Creates Registry Key called MyCompany. +EXAMPLES = r''' +- name: Create Registry Key called MyCompany win_regedit: key: HKCU:\Software\MyCompany - # Creates Registry Key called MyCompany, - # a value within MyCompany Key called "hello", and - # data for the value "hello" containing "world". +- name: Create Registry Key called MyCompany, a value within MyCompany Key called "hello", and data for the value "hello" containing "world". win_regedit: key: HKCU:\Software\MyCompany value: hello data: world - # Creates Registry Key called MyCompany, - # a value within MyCompany Key called "hello", and - # data for the value "hello" containing "1337" as type "dword". +- name: Create Registry Key called MyCompany, a value within MyCompany Key called "hello", and data for the value "hello" containing "1337" as type "dword". win_regedit: key: HKCU:\Software\MyCompany value: hello data: 1337 datatype: dword - # Creates Registry Key called MyCompany, - # a value within MyCompany Key called "hello", and - # binary data for the value "hello" as type "binary" - # data expressed as comma separated list +- name: Create Registry Key called MyCompany, a value within MyCompany Key called "hello", and binary data for the value "hello" as type "binary" data expressed as comma separated list win_regedit: key: HKCU:\Software\MyCompany value: hello data: hex:be,ef,be,ef,be,ef,be,ef,be,ef datatype: binary - # Creates Registry Key called MyCompany, - # a value within MyCompany Key called "hello", and - # binary data for the value "hello" as type "binary" - # data expressed as yaml array of bytes +- name: Create Registry Key called MyCompany, a value within MyCompany Key called "hello", and binary data for the value "hello" as type "binary" data expressed as yaml array of bytes win_regedit: key: HKCU:\Software\MyCompany value: hello data: [0xbe,0xef,0xbe,0xef,0xbe,0xef,0xbe,0xef,0xbe,0xef] datatype: binary - # Delete Registry Key MyCompany - # NOTE: Not specifying a value will delete the root key which means - # all values will be deleted +- name: Delete Registry Key MyCompany. Not specifying a value will delete the root key which means all values will be deleted win_regedit: key: HKCU:\Software\MyCompany state: absent - # Delete Registry Value "hello" from MyCompany Key +- name: Delete Registry Value "hello" from MyCompany Key win_regedit: key: HKCU:\Software\MyCompany value: hello state: absent - # Ensure registry paths containing spaces are quoted. - # Creates Registry Key called 'My Company'. +- name: Creates Registry Key called 'My Company' win_regedit: - key: 'HKCU:\Software\My Company' - + key: HKCU:\Software\My Company ''' + RETURN = ''' data_changed: description: whether this invocation changed the data in the registry value