diff --git a/manifests/site.pp b/manifests/site.pp index 0394279049..b825e992c5 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -33,6 +33,10 @@ node 'gerrit-dev.openstack.org', 'review-dev.openstack.org' { email_private_key => hiera('gerrit_dev_email_private_key'), contactstore_appsec => hiera('gerrit_dev_contactstore_appsec'), contactstore_pubkey => hiera('gerrit_dev_contactstore_pubkey'), + lp_sync_key => hiera('gerrit_dev_lp_sync_key'), + lp_sync_pubkey => hiera('gerrit_dev_lp_sync_pubkey'), + lp_sync_token => hiera('gerrit_dev_lp_access_token'), + lp_sync_secret => hiera('gerrit_dev_lp_access_secret'), sysadmins => hiera('sysadmins'), } } diff --git a/modules/openstack_project/manifests/review_dev.pp b/modules/openstack_project/manifests/review_dev.pp index 5ff27e530d..4fbc4b3af1 100644 --- a/modules/openstack_project/manifests/review_dev.pp +++ b/modules/openstack_project/manifests/review_dev.pp @@ -9,6 +9,10 @@ class openstack_project::review_dev ( $cla_file='static/cla.html', $cla_id='2', $cla_name='ICLA', + $lp_sync_key='', # If left empty puppet will not create file. + $lp_sync_pubkey='', # If left empty puppet will not create file. + $lp_sync_token='', + $lp_sync_secret='', $sysadmins = [] ) { class { 'openstack_project::gerrit': @@ -60,6 +64,52 @@ class openstack_project::review_dev ( replace => 'true', require => Class['::gerrit'] } + file { '/home/gerrit2/.ssh': + ensure => directory, + owner => 'gerrit2', + group => 'gerrit2', + mode => '0700', + require => User['gerrit2'], + } + if $lp_sync_key != '' { + file { '/home/gerrit2/.ssh/launchpadsync_rsa': + ensure => present, + owner => 'gerrit2', + group => 'gerrit2', + mode => '0600', + content => $lp_sync_key, + replace => true, + require => User['gerrit2'], + } + } + if $lp_sync_pubkey != '' { + file { '/home/gerrit2/.ssh/launchpadsync_rsa.pub': + ensure => present, + owner => 'gerrit2', + group => 'gerrit2', + mode => '0644', + content => $lp_sync_pubkey, + replace => true, + require => User['gerrit2'], + } + } + file { '/home/gerrit2/.launchpadlib': + ensure => directory, + owner => 'gerrit2', + group => 'gerrit2', + mode => '0775', + require => User['gerrit2'], + } + file { '/home/gerrit2/.launchpadlib/creds': + ensure => present, + owner => 'gerrit2', + group => 'gerrit2', + mode => '0600', + content => template('openstack_project/gerrit_dev_lp_creds.erb'), + replace => true, + require => User['gerrit2'], + } + exec { 'set_contributor_agreements': path => ['/bin', '/usr/bin'], command => '/home/gerrit2/review_site/bin/set_agreements.sh', diff --git a/modules/openstack_project/templates/gerrit_dev_lp_creds.erb b/modules/openstack_project/templates/gerrit_dev_lp_creds.erb new file mode 100644 index 0000000000..42271514a2 --- /dev/null +++ b/modules/openstack_project/templates/gerrit_dev_lp_creds.erb @@ -0,0 +1,6 @@ +[1] +consumer_key = System-wide: Ubuntu (gerrit-dev.openstack.org) +consumer_secret = +access_token = <%= lp_sync_token %> +access_secret = <%= lp_sync_secret %> +