From cc34e25fd54e60caf744130d90c14f8d839c7823 Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Mon, 7 Dec 2015 07:55:32 -0800 Subject: 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 --- site/profile/manifests/zack_r10k_webhook.pp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'site/profile/manifests/zack_r10k_webhook.pp') 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", -- cgit v1.2.3