git.lirion.de

Of git, get, and gud

summaryrefslogtreecommitdiffstats
path: root/site/profile/manifests/zack_r10k_webhook.pp
diff options
context:
space:
mode:
authormail_redacted_for_web 2015-12-07 07:55:32 -0800
committermail_redacted_for_web 2015-12-18 09:22:44 -0800
commitcc34e25fd54e60caf744130d90c14f8d839c7823 (patch)
treeaf3f767b92ac48b17795fcadfe70e852a658b0df /site/profile/manifests/zack_r10k_webhook.pp
parent1b0f63be83464dc7bdc9561b3d5b3a937a4dfb39 (diff)
downloadcontrol-repo-template-cc34e25fd54e60caf744130d90c14f8d839c7823.tar.bz2
Final steps to make Code Manager work
- Moved ssh key generation and git deploy key out of the puppetmaster profile and into zack_r10k and code_manager - Swapped code manager into the all_in_one role - Made a 2015.2 all_in_one role if users prefer to use it - Conditionally move all existing code out of environmentpath to allow file sync to sync files - Update the README to compliment the new puppet code
Diffstat (limited to 'site/profile/manifests/zack_r10k_webhook.pp')
-rw-r--r--site/profile/manifests/zack_r10k_webhook.pp18
1 files changed, 16 insertions, 2 deletions
diff --git a/site/profile/manifests/zack_r10k_webhook.pp b/site/profile/manifests/zack_r10k_webhook.pp
index f35f856..0ab4da2 100644
--- a/site/profile/manifests/zack_r10k_webhook.pp
+++ b/site/profile/manifests/zack_r10k_webhook.pp
@@ -9,11 +9,9 @@ class profile::zack_r10k_webhook (
$git_management_system = hiera('git_management_system', undef)
if $use_mcollective {
-
class { 'r10k::mcollective':
notify => Service['mcollective'],
}
-
}
class {'r10k::webhook::config':
@@ -30,7 +28,23 @@ class profile::zack_r10k_webhook (
require => Class['r10k::webhook::config'],
}
+ $r10k_ssh_key_file = '/root/.ssh/r10k_rsa'
+ exec { 'create r10k ssh key' :
+ command => "/usr/bin/ssh-keygen -t rsa -b 2048 -C 'r10k' -f ${r10k_ssh_key_file} -q -N ''",
+ creates => $r10k_ssh_key_file,
+ }
+
if !empty($gms_api_token) {
+ git_deploy_key { "add_deploy_key_to_puppet_control-${::fqdn}":
+ ensure => present,
+ name => $::fqdn,
+ path => "${r10k_ssh_key_file}.pub",
+ token => $gms_api_token,
+ project_name => 'puppet/control-repo',
+ server_url => hiera('gms_server_url'),
+ provider => $git_management_system,
+ }
+
git_webhook { "web_post_receive_webhook-${::fqdn}" :
ensure => present,
webhook_url => "https://${username}:${password}@${::fqdn}:8088/payload",