creating a subscription to registry creation on a windows machine

5 views
Skip to first unread message

Raghu Ram Baisani

unread,
Dec 21, 2020, 4:31:46 AM12/21/20
to Puppet Users
Hi All

Is it possible to create a subscription to registry creation so that once registry entry is created then we can restart the box/machine? For creating the registry entry I'm using create_resources function.
Thanks
Raghuram Baisani

KevinR

unread,
Dec 21, 2020, 7:14:53 AM12/21/20
to Puppet Users
Hi Raghuram,

yes this is achieved with the subscribe meta parameter. For example:

registry_value { 'disable_defender':
    ensure => present,
    type   => dword,
    path   => 'HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\DisableAntiSpyware',
    value  => 1
}

reboot { 'regkey_reboot':
   subscribe => Registry_value['disable_defender']
}

Kind regards,
Kevin Reeuwijk
Sr Principal Sales Engineer, EMEA
Reply all
Reply to author
Forward
0 new messages