forked from puppetlabs/puppetlabs-peadm
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(puppetlabs#469) Assign correct environment to node groups
- Loading branch information
1 parent
4a27e2d
commit 33355ab
Showing
5 changed files
with
55 additions
and
1 deletion.
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 |
---|---|---|
@@ -1 +1 @@ | ||
2.7.8 | ||
3.0.7 |
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
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,28 @@ | ||
# | ||
# @summary check if a custom PE environment is set in pe.conf | ||
# | ||
# @param primary the FQDN for the primary, here we will read the pe.conf from | ||
# | ||
# @see https://www.puppet.com/docs/pe/latest/upgrade_pe#update_environment | ||
# | ||
# @author Tim Meusel <tim@bastelfreak.de> | ||
# | ||
function peadm::get_node_group_environment(Target $primary) { | ||
$peconf = peadm::get_pe_conf($primary) | ||
# if both are set, they need to be set to the same value | ||
# if they are not set, we assume that the user runs their infra in production | ||
$pe_install = $peconf['pe_install::install::classification::pe_node_group_environment'] | ||
$puppet_enterprise = $peconf['puppet_enterprise::master::recover_configuration::pe_environment'] | ||
|
||
# check if both are equal | ||
# This also evaluates to true if both are undef | ||
if $pe_install == $puppet_enterprise { | ||
if $pe_install =~ String[1] { | ||
return $pe_install | ||
} else { | ||
return 'production' | ||
} | ||
} else { | ||
fail("pe_install::install::classification::pe_node_group_environment and puppet_enterprise::master::recover_configuration::pe_environment need to be set to the same value, not '${pe_install}' and ${puppet_enterprise}") | ||
} | ||
} |
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
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