diff --git a/manifests/site.pp b/manifests/site.pp index ccd2c72934..367ea26d1e 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -243,6 +243,9 @@ node 'static.openstack.org' { reviewday_rsa_key_contents => hiera('reviewday_rsa_key_contents'), reviewday_rsa_pubkey_contents => hiera('reviewday_rsa_pubkey_contents'), reviewday_gerrit_ssh_key => hiera('gerrit_ssh_rsa_pubkey_contents'), + releasestatus_prvkey_contents => hiera('releasestatus_rsa_key_contents'), + releasestatus_pubkey_contents => hiera('releasestatus_rsa_pubkey_contents'), + releasestatus_gerrit_ssh_key => hiera('gerrit_ssh_rsa_pubkey_contents'), } } diff --git a/modules/openstack_project/manifests/static.pp b/modules/openstack_project/manifests/static.pp index a4674ef3a9..768394105e 100644 --- a/modules/openstack_project/manifests/static.pp +++ b/modules/openstack_project/manifests/static.pp @@ -4,7 +4,10 @@ class openstack_project::static ( $sysadmins = [], $reviewday_gerrit_ssh_key = '', $reviewday_rsa_pubkey_contents = '', - $reviewday_rsa_key_contents = '' + $reviewday_rsa_key_contents = '', + $releasestatus_prvkey_contents = '', + $releasestatus_pubkey_contents = '', + $releasestatus_gerrit_ssh_key = '', ) { class { 'openstack_project::server': @@ -274,7 +277,11 @@ class openstack_project::static ( ########################################################### # Status - releasestatus - include releasestatus + class { 'releasestatus': + releasestatus_prvkey_contents => $releasestatus_prvkey_contents, + releasestatus_pubkey_contents => $releasestatus_pubkey_contents, + releasestatus_gerrit_ssh_key => $releasestatus_gerrit_ssh_key, + } releasestatus::site { 'releasestatus': configfile => 'integrated.yaml', diff --git a/modules/releasestatus/manifests/init.pp b/modules/releasestatus/manifests/init.pp index 801e605a4c..3c30d058f9 100644 --- a/modules/releasestatus/manifests/init.pp +++ b/modules/releasestatus/manifests/init.pp @@ -14,7 +14,11 @@ # # Class: releasestatus # -class releasestatus { +class releasestatus ( + $releasestatus_prvkey_contents = '', + $releasestatus_pubkey_contents = '', + $releasestatus_gerrit_ssh_key = '', +) { if ! defined(Package['python-launchpadlib']) { package { 'python-launchpadlib': ensure => present, @@ -54,6 +58,47 @@ class releasestatus { require => User['releasestatus'], } + file { '/var/lib/releasestatus/.ssh/': + ensure => directory, + owner => 'releasestatus', + group => 'releasestatus', + mode => '0700', + require => File['/var/lib/releasestatus'], + } + + if $releasestatus_prvkey_contents != '' { + file { '/var/lib/releasestatus/.ssh/id_rsa': + owner => 'releasestatus', + group => 'releasestatus', + mode => '0600', + content => $releasestatus_prvkey_contents, + replace => true, + require => File['/var/lib/releasestatus/.ssh/'] + } + } + + if $releasestatus_pubkey_contents != '' { + file { '/var/lib/releasestatus/.ssh/id_rsa.pub': + owner => 'releasestatus', + group => 'releasestatus', + mode => '0600', + content => $releasestatus_pubkey_contents, + replace => true, + require => File['/var/lib/releasestatus/.ssh/'] + } + } + + if $releasestatus_gerrit_ssh_key != '' { + file { '/var/lib/releasestatus/.ssh/known_hosts': + owner => 'releasestatus', + group => 'releasestatus', + mode => '0600', + content => "review.openstack.org ${releasestatus_gerrit_ssh_key}", + replace => true, + require => File['/var/lib/releasestatus/.ssh/'] + } + } + vcsrepo { '/var/lib/releasestatus/releasestatus': ensure => latest, provider => git,