win_reg_stat – Get information about Windows registry keys¶
Synopsis¶
Like win_file, win_reg_stat will return whether the key/property exists.
It also returns the sub keys and properties of the key specified.
If specifying a property name through property, it will return the information specific for that property.
Parameters¶
Notes¶
Note
The
properties
return value will contain an empty string key""
that refers to the key’sDefault
value. If the value has not been set then this key is not returned.
See Also¶
See also
- win_regedit – Add, change, or remove registry keys and values
The official documentation on the win_regedit module.
- win_regmerge – Merges the contents of a registry file into the Windows registry
The official documentation on the win_regmerge module.
Examples¶
- name: Obtain information about a registry key using short form
win_reg_stat:
path: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion
register: current_version
- name: Obtain information about a registry key property
win_reg_stat:
path: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion
name: CommonFilesDir
register: common_files_dir
- name: Obtain the registry key's (Default) property
win_reg_stat:
path: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion
name: ''
register: current_version_default
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Status¶
This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by the Ansible Community. [community]
Authors¶
Jordan Borean (@jborean93)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.