This module adds a type to reboot Windows and Linux systems. It is supported by Puppet Enterprise. We possibly need time to reboot our systems. We cannot use reboot without any conditions. Otherwise, each run will cause a reboot and everybody will start complaining about the reboots. So, it is a good practice to limit these with a notice
or register
option.
The URL for the puppetlabs/reboot
module is https://forge.puppetlabs.com/puppetlabs/reboot. To install this, simply run the following command on a terminal:
$ sudo puppet module install puppetlabs-reboot
Following is a sample reboot
definition. In this example, the reboot
subscribes to a file creation. Whenever testfile.txt
is created, it will trigger the reboot
:
reboot { 'name': subscribe => File['c:/testfile.txt'], }
Now, let's see this in an example. We will create a simple module that creates a file. Whenever this file is created, it will trigger a reboot. Our example module name is testreboot
. The structure is as...