Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrappers fro reboot and iis, + firstrun docs
- Loading branch information
Showing
4 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
psick::puppet::pe_agent::config_file_path: 'c:/programdata/puppetlabs/puppet/etc/puppet.conf' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
## First run mode | ||
|
||
First run mode is a special condition, which can be applied at the first Puppet run | ||
on the clients, where a seleceted number of classes are included and configured. | ||
Optionally, a reboot may be triggered at the end of this first Puppet run. | ||
|
||
The next Puppet runs will be normal and will use the normal configurations expected | ||
in each nodes. | ||
|
||
Possible use cases for Firstrun mode: | ||
- Set a desired hostname on Windows, reboot and join an AD domain | ||
- Install aws-sdk gem, reboot and have ec2_tags facts since the first real Puppet run | ||
- Set external facts with configurable content (not via pluginsync) and run a catalog | ||
only when they are loaded (after the first Puppet run) | ||
- Any case where a configuration or some installations have to be done | ||
in a separated and never repeating first Puppet run. With or without a | ||
system reboot. | ||
|
||
To enable first run mode (by default it's disabled) set: | ||
|
||
psick::enable_firstrun: true | ||
|
||
To define which classes to include in nodes, according to each $::kernel: | ||
|
||
psick::firstrun::windows_classes: | ||
hostname: psick::hostname | ||
psick::firstrun::windows_reboot: true # (Default value) | ||
|
||
psick::firstrun::linux_classes: | ||
hostname: psick::hostname | ||
proxy: psick::proxy | ||
psick::firstrun::linux_reboot: false # (Default value) | ||
|
||
IMPORTANT NOTE: If firstrun mode is activated on an existing infrastructure or if | ||
the 'firstrun' external fact is removed from nodes, this class will be included | ||
in the main psick class as if this were a real first Puppet run. | ||
This will trigger a, probably unwanted, reboot on Windows nodes (and in any | ||
other node for which reboot is configured. | ||
|
||
Set psick::firstrun::${kernel}_reboot to false to prevent undesired reboots. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# | ||
class psick::iis ( | ||
Hash $features = {}, | ||
Hash $sites = {}, | ||
Hash $applications = {}, | ||
Hash $application_pools = {}, | ||
Hash $virtual_directories = {}, | ||
) { | ||
|
||
$features.each | $k,$v | { | ||
iis_feature { $k: | ||
* => $v, | ||
} | ||
} | ||
$sites.each | $k,$v | { | ||
iis_site { $k: | ||
* => $v, | ||
} | ||
} | ||
$applications.each | $k,$v | { | ||
iis_application { $k: | ||
* => $v, | ||
} | ||
} | ||
$application_pools.each | $k,$v | { | ||
iis_application_pool { $k: | ||
* => $v, | ||
} | ||
} | ||
$virtual_directories.each | $k,$v | { | ||
iis_virtual_directory { $k: | ||
* => $v, | ||
} | ||
} | ||
include ::iis | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This profile triggers a system reboot | ||
# | ||
# This profiles uses puppetfile/reboot module to manage | ||
# system reboots. | ||
# | ||
# @example Enable firstrun mode and set reboot class on windows | ||
# and linux | ||
# firstrun_enable: true | ||
# psick::firstrun::linux::reboot_class: psick::reboot | ||
# psick::firstrun::windows::reboot_class: psick::reboot | ||
# | ||
class psick::reboot ( | ||
Boolean $manage = true, | ||
Enum['immediately','finished'] $apply = 'finished', | ||
Enum['refreshed','pending'] $when = 'pending', | ||
String $reboot_name = 'Psick Reboot', | ||
Integer $timeout = 60, | ||
) { | ||
|
||
$message = "Rebooting: when ${when} - apply ${apply} - timeout ${timeout}" | ||
if $manage { | ||
reboot { $reboot_name: | ||
apply => $apply, | ||
message => $message, | ||
when => $when, | ||
timeout => $timeout, | ||
} | ||
} | ||
} |