ansible.windows.win_reg_stat – Get information about Windows registry keys¶
Note
This plugin is part of the ansible.windows collection (version 1.4.0).
To install it use: ansible-galaxy collection install ansible.windows
.
To use it in a playbook, specify: ansible.windows.win_reg_stat
.
Synopsis¶
Like ansible.windows.win_file, ansible.windows.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
- ansible.windows.win_regedit
The official documentation on the ansible.windows.win_regedit module.
- ansible.windows.win_regmerge
The official documentation on the ansible.windows.win_regmerge module.
Examples¶
- name: Obtain information about a registry key using short form
ansible.windows.win_reg_stat:
path: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion
register: current_version
- name: Obtain information about a registry key property
ansible.windows.win_reg_stat:
path: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion
name: CommonFilesDir
register: common_files_dir
- name: Obtain the registry key's (Default) property
ansible.windows.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:
Authors¶
Jordan Borean (@jborean93)