mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Improve YAML examples - windows/win_regedit.py (#19400)
This commit is contained in:
parent
b6f2565d60
commit
fb0779f657
1 changed files with 11 additions and 24 deletions
|
@ -76,67 +76,54 @@ options:
|
||||||
author: "Adam Keech (@smadam813), Josh Ludwig (@joshludwig)"
|
author: "Adam Keech (@smadam813), Josh Ludwig (@joshludwig)"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r'''
|
||||||
# Creates Registry Key called MyCompany.
|
- name: Create Registry Key called MyCompany
|
||||||
win_regedit:
|
win_regedit:
|
||||||
key: HKCU:\Software\MyCompany
|
key: HKCU:\Software\MyCompany
|
||||||
|
|
||||||
# Creates Registry Key called MyCompany,
|
- name: Create Registry Key called MyCompany, a value within MyCompany Key called "hello", and data for the value "hello" containing "world".
|
||||||
# a value within MyCompany Key called "hello", and
|
|
||||||
# data for the value "hello" containing "world".
|
|
||||||
win_regedit:
|
win_regedit:
|
||||||
key: HKCU:\Software\MyCompany
|
key: HKCU:\Software\MyCompany
|
||||||
value: hello
|
value: hello
|
||||||
data: world
|
data: world
|
||||||
|
|
||||||
# Creates Registry Key called MyCompany,
|
- name: Create Registry Key called MyCompany, a value within MyCompany Key called "hello", and data for the value "hello" containing "1337" as type "dword".
|
||||||
# a value within MyCompany Key called "hello", and
|
|
||||||
# data for the value "hello" containing "1337" as type "dword".
|
|
||||||
win_regedit:
|
win_regedit:
|
||||||
key: HKCU:\Software\MyCompany
|
key: HKCU:\Software\MyCompany
|
||||||
value: hello
|
value: hello
|
||||||
data: 1337
|
data: 1337
|
||||||
datatype: dword
|
datatype: dword
|
||||||
|
|
||||||
# Creates Registry Key called MyCompany,
|
- 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
|
||||||
# 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:
|
win_regedit:
|
||||||
key: HKCU:\Software\MyCompany
|
key: HKCU:\Software\MyCompany
|
||||||
value: hello
|
value: hello
|
||||||
data: hex:be,ef,be,ef,be,ef,be,ef,be,ef
|
data: hex:be,ef,be,ef,be,ef,be,ef,be,ef
|
||||||
datatype: binary
|
datatype: binary
|
||||||
|
|
||||||
# Creates Registry Key called MyCompany,
|
- 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
|
||||||
# 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:
|
win_regedit:
|
||||||
key: HKCU:\Software\MyCompany
|
key: HKCU:\Software\MyCompany
|
||||||
value: hello
|
value: hello
|
||||||
data: [0xbe,0xef,0xbe,0xef,0xbe,0xef,0xbe,0xef,0xbe,0xef]
|
data: [0xbe,0xef,0xbe,0xef,0xbe,0xef,0xbe,0xef,0xbe,0xef]
|
||||||
datatype: binary
|
datatype: binary
|
||||||
|
|
||||||
# Delete Registry Key MyCompany
|
- name: Delete Registry Key MyCompany. Not specifying a value will delete the root key which means all values will be deleted
|
||||||
# NOTE: Not specifying a value will delete the root key which means
|
|
||||||
# all values will be deleted
|
|
||||||
win_regedit:
|
win_regedit:
|
||||||
key: HKCU:\Software\MyCompany
|
key: HKCU:\Software\MyCompany
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
# Delete Registry Value "hello" from MyCompany Key
|
- name: Delete Registry Value "hello" from MyCompany Key
|
||||||
win_regedit:
|
win_regedit:
|
||||||
key: HKCU:\Software\MyCompany
|
key: HKCU:\Software\MyCompany
|
||||||
value: hello
|
value: hello
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
# Ensure registry paths containing spaces are quoted.
|
- name: Creates Registry Key called 'My Company'
|
||||||
# Creates Registry Key called 'My Company'.
|
|
||||||
win_regedit:
|
win_regedit:
|
||||||
key: 'HKCU:\Software\My Company'
|
key: HKCU:\Software\My Company
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
data_changed:
|
data_changed:
|
||||||
description: whether this invocation changed the data in the registry value
|
description: whether this invocation changed the data in the registry value
|
||||||
|
|
Loading…
Reference in a new issue