win_regmerge – Merges the contents of a registry file into the Windows registry¶
Synopsis¶
Wraps the reg.exe command to import the contents of a registry file.
Suitable for use with registry files created using win_template.
Windows registry files have a specific format and must be constructed correctly with carriage return and line feed line endings otherwise they will not be merged.
Exported registry files often start with a Byte Order Mark which must be removed if the file is to templated using win_template.
Registry file format is described at https://support.microsoft.com/en-us/kb/310516
See also win_template, win_regedit
Parameters¶
Notes¶
Note
Organise your registry files so that they contain a single root registry key if you want to use the compare_to functionality.
This module does not force registry settings to be in the state described in the file. If registry settings have been modified externally the module will merge the contents of the file but continue to report differences on subsequent runs.
To force registry change, use win_regedit with
state=absent
before usingwin_regmerge
.
See Also¶
See also
- win_reg_stat – Get information about Windows registry keys
The official documentation on the win_reg_stat module.
- win_regedit – Add, change, or remove registry keys and values
The official documentation on the win_regedit module.
Examples¶
- name: Merge in a registry file without comparing to current registry
win_regmerge:
path: C:\autodeploy\myCompany-settings.reg
- name: Compare and merge registry file
win_regmerge:
path: C:\autodeploy\myCompany-settings.reg
compare_to: HKLM:\SOFTWARE\myCompany
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¶
Jon Hawkesworth (@jhawkesworth)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.