From 17b1469c2e87d3d62eb9bfa38b08d9055d58c8aa Mon Sep 17 00:00:00 2001 From: Spencer Krum Date: Sun, 16 Nov 2014 19:32:44 +0000 Subject: [PATCH] Create puppet-forge credentials on the pypi slave This will enable puppet forge release of puppet modules using the release pipeline. See https://review.openstack.org/134834 for the details. Change-Id: I7c3004828df34672442d190bb60a8a342cacffd0 --- manifests/site.pp | 2 ++ modules/openstack_project/manifests/pypi_slave.pp | 13 ++++++++++++- .../openstack_project/templates/puppetforge.yml.erb | 4 ++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 modules/openstack_project/templates/puppetforge.yml.erb diff --git a/manifests/site.pp b/manifests/site.pp index 9957885e10..9f976e4827 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -594,6 +594,8 @@ node 'pypi.slave.openstack.org' { jenkinsci_password => hiera('jenkins_ci_org_password', 'XXX'), mavencentral_username => hiera('mavencentral_org_user', 'username'), mavencentral_password => hiera('mavencentral_org_password', 'XXX'), + puppet_forge_username => hiera('puppet_forge_username', 'username'), + puppet_forge_password => hiera('puppet_forge_password', 'XXX'), } } diff --git a/modules/openstack_project/manifests/pypi_slave.pp b/modules/openstack_project/manifests/pypi_slave.pp index 6f9a0f8de6..7f44e7e74b 100644 --- a/modules/openstack_project/manifests/pypi_slave.pp +++ b/modules/openstack_project/manifests/pypi_slave.pp @@ -22,7 +22,9 @@ class openstack_project::pypi_slave ( $jenkinsci_username, $jenkinsci_password, $mavencentral_username, - $mavencentral_password + $mavencentral_password, + $puppet_forge_username, + $puppet_forge_password, ) { class { 'openstack_project::slave': ssh_key => $jenkins_ssh_public_key, @@ -69,4 +71,13 @@ class openstack_project::pypi_slave ( require => File['/home/jenkins'], } + file { '/home/jenkins/.puppetforge.yml': + ensure => present, + owner => 'jenkins', + group => 'jenkins', + mode => '0600', + content => template('openstack_project/puppetforge.yml.erb'), + require => File['/home/jenkins'], + } + } diff --git a/modules/openstack_project/templates/puppetforge.yml.erb b/modules/openstack_project/templates/puppetforge.yml.erb new file mode 100644 index 0000000000..c127e0c73a --- /dev/null +++ b/modules/openstack_project/templates/puppetforge.yml.erb @@ -0,0 +1,4 @@ +--- +url: https://forgeapi.puppetlabs.com +username: <%= @puppet_forge_username -%> +password: <%= @puppet_forge_password -%>