Skip to content

Commit d2db275

Browse files
committed
Create profile::git_webhook to abstract away the details
Prior to this commit there were two possible webhooks - zack/r10k webhook - code manager I moved these two profiles under git_webhook and choose the correct one based on the version of PE being used. As a safety hatch, I provide the $force_zack_r10k_webhook param on profile::git_webhook in case someone needs to continue using it instead of code manager.
1 parent 56d0908 commit d2db275

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class profile::git_webhook (
2+
$force_zack_r10k_webhook = false
3+
) {
4+
5+
if versioncmp( $::pe_server_version, '2015.2.99' ) <= 0 or $force_zack_r10k_webhook {
6+
include profile::git_webhook::zack_r10k_webhook
7+
} else {
8+
include profile::git_webhook::code_manager
9+
}
10+
11+
}

site/profile/manifests/code_manager.pp renamed to site/profile/manifests/git_webhook/code_manager.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class profile::code_manager {
1+
class profile::git_webhook::code_manager {
22

33
$authenticate_webhook = hiera('puppet_enterprise::master::code_manager::authenticate_webhook', true)
44

@@ -51,7 +51,7 @@
5151
}
5252

5353
exec { "Generate Token for ${code_manager_service_user}" :
54-
command => epp('profile/code_manager/create_rbac_token.epp',
54+
command => epp('profile/git_webhook/code_manager/create_rbac_token.epp',
5555
{ 'code_manager_service_user' => $code_manager_service_user,
5656
'code_manager_service_user_password' => $code_manager_service_user_password,
5757
'classifier_hostname' => $classifier_hostname,

site/profile/manifests/zack_r10k_webhook.pp renamed to site/profile/manifests/git_webhook/zack_r10k_webhook.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class profile::zack_r10k_webhook (
1+
class profile::git_webhook::zack_r10k_webhook (
22
$use_mcollective = false,
33
) {
44

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class role::all_in_one_pe {
22

33
include profile::puppetmaster
4-
include profile::code_manager
4+
include profile::git_webhook
55

66
}

0 commit comments

Comments
 (0)