Ansible, Windows and PowerShell: the Basics – Part 14, Registry Entries
In Part 14 of this series we’ll continue our journey with Ansible, Windows and PowerShell and look at how to handle registry entries in Windows.
In this example we’ll look at how to both create a new registry entry and update an existing registry entry using the win_regedit Ansible module.
Our current view of registry entry HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters is as follows:
Our job template in AWX is _13_registry_entries:
The contents of _13_registry_entries.yml are as follows:
In the first step we create the new registry entry, in the second we update the existing entry.
Running a job from the _13_registry_entries job template produces the following result:
Observe the newly created and existing updated registry entries.
- Ansible, Windows and PowerShell: the Basics – Introduction
- Ansible, Windows and PowerShell: the Basics - Part 1, Windows Services
- Ansible, Windows and PowerShell: the Basics - Part 2, Install PowerShell Modules
- Ansible, Windows and PowerShell: the Basics – Part 3, Windows Roles and Features
- Ansible, Windows and PowerShell: the Basics – Part 4, Invoking PowerShell Code
- Ansible, Windows and PowerShell: the Basics – Part 5, Example PowerShell Error Handling
- Ansible, Windows and PowerShell: the Basics – Part 6, Displaying Output from PowerShell Code
- Ansible, Windows and PowerShell: the Basics – Part 7, Utilising PowerShell DSC
- Ansible, Windows and PowerShell: the Basics – Part 8, Rebooting & Waiting
- Ansible, Windows and PowerShell: the Basics – Part 9, Disk Creation
- Ansible, Windows and PowerShell: the Basics – Part 10, Local Users
- Ansible, Windows and PowerShell: the Basics – Part 11, Local Groups
- Ansible, Windows and PowerShell: the Basics – Part 12, Set TimeZone
- Ansible, Windows and PowerShell: the Basics – Part 13, Environment Variables
- Ansible, Windows and PowerShell: the Basics – Part 14, Registry Entries
- Ansible, Windows and PowerShell: the Basics – Part 15, Install Chocolatey Packages