From 9a612ee9bc3bf20b5553e33b98045e964104ce64 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Wed, 17 Aug 2016 18:29:36 +0000 Subject: [PATCH] Make Launchpad credentials reusable Refactor and rename our Launchpad "sync" credentials (they haven't been used to synchronize group membership from LP to Gerrit for nearly 4 years now) which currently perform bug updates for new/merged changes, so that they can be reused in the future to update bugs as a part of release automation jobs. Change-Id: Icd08dffef88fc8e99683d991ac6ac88b93bcb3e6 --- manifests/site.pp | 12 ++++++------ modules/openstack_project/manifests/review.pp | 10 +++++----- modules/openstack_project/manifests/review_dev.pp | 9 +++++---- .../openstack_project/templates/gerrit_lp_creds.erb | 6 ------ .../openstack_project/templates/infra_lp_creds.erb | 5 +++++ 5 files changed, 21 insertions(+), 21 deletions(-) delete mode 100644 modules/openstack_project/templates/gerrit_lp_creds.erb create mode 100644 modules/openstack_project/templates/infra_lp_creds.erb diff --git a/manifests/site.pp b/manifests/site.pp index 794f3dac0c..31d6ccea25 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -52,9 +52,9 @@ node 'review.openstack.org' { ssh_welcome_rsa_pubkey_contents => hiera('welcome_message_gerrit_ssh_public_key'), ssh_replication_rsa_key_contents => hiera('gerrit_replication_ssh_rsa_key_contents'), ssh_replication_rsa_pubkey_contents => hiera('gerrit_replication_ssh_rsa_pubkey_contents'), - lp_sync_consumer_key => hiera('gerrit_lp_consumer_key'), - lp_sync_token => hiera('gerrit_lp_access_token'), - lp_sync_secret => hiera('gerrit_lp_access_secret'), + lp_access_token => hiera('gerrit_lp_access_token'), + lp_access_secret => hiera('gerrit_lp_access_secret'), + lp_consumer_key => hiera('gerrit_lp_consumer_key'), contactstore_appsec => hiera('gerrit_contactstore_appsec'), contactstore_pubkey => hiera('gerrit_contactstore_pubkey'), swift_username => hiera('swift_store_user', 'username'), @@ -89,9 +89,9 @@ node 'review-dev.openstack.org' { ssh_project_rsa_pubkey_contents => hiera('gerrit_dev_project_ssh_rsa_pubkey_contents'), ssh_replication_rsa_key_contents => hiera('gerrit_dev_replication_ssh_rsa_key_contents'), ssh_replication_rsa_pubkey_contents => hiera('gerrit_dev_replication_ssh_rsa_pubkey_contents'), - lp_sync_consumer_key => hiera('gerrit_dev_lp_consumer_key'), - lp_sync_token => hiera('gerrit_dev_lp_access_token'), - lp_sync_secret => hiera('gerrit_dev_lp_access_secret'), + lp_access_token => hiera('gerrit_dev_lp_access_token'), + lp_access_secret => hiera('gerrit_dev_lp_access_secret'), + lp_consumer_key => hiera('gerrit_dev_lp_consumer_key'), storyboard_password => hiera('gerrit_dev_storyboard_token'), storyboard_ssl_cert => hiera('gerrit_dev_storyboard_ssl_crt'), } diff --git a/modules/openstack_project/manifests/review.pp b/modules/openstack_project/manifests/review.pp index 41106dca1c..0802dbba16 100644 --- a/modules/openstack_project/manifests/review.pp +++ b/modules/openstack_project/manifests/review.pp @@ -71,10 +71,10 @@ class openstack_project::review ( # welcome-message's user ssh key. $ssh_welcome_rsa_key_contents='', $ssh_welcome_rsa_pubkey_contents='', - # To be renamed - they're now just launchpad creds, not lp_sync - $lp_sync_consumer_key='', - $lp_sync_token='', - $lp_sync_secret='', + # Launchpad creds for bug/blueprint updates + $lp_access_token='', + $lp_access_secret='', + $lp_consumer_key='', # For gerrit's contactstore feature # https://review.openstack.org/Documentation/config-contact.html $contactstore = true, @@ -334,7 +334,7 @@ class openstack_project::review ( owner => 'gerrit2', group => 'gerrit2', mode => '0600', - content => template('openstack_project/gerrit_lp_creds.erb'), + content => template('openstack_project/infra_lp_creds.erb'), replace => true, require => User['gerrit2'], } diff --git a/modules/openstack_project/manifests/review_dev.pp b/modules/openstack_project/manifests/review_dev.pp index 08605d3f16..7c3a7a3a55 100644 --- a/modules/openstack_project/manifests/review_dev.pp +++ b/modules/openstack_project/manifests/review_dev.pp @@ -19,9 +19,10 @@ class openstack_project::review_dev ( # SSH key for outbound ssh-based replication. $ssh_replication_rsa_key_contents='', $ssh_replication_rsa_pubkey_contents='', - $lp_sync_consumer_key = '', - $lp_sync_token = '', - $lp_sync_secret = '', + # Launchpad creds for bug/blueprint updates + $lp_access_token = '', + $lp_access_secret = '', + $lp_consumer_key = '', $swift_username = '', $swift_password = '', $storyboard_password = '', @@ -228,7 +229,7 @@ class openstack_project::review_dev ( owner => 'gerrit2', group => 'gerrit2', mode => '0600', - content => template('openstack_project/gerrit_lp_creds.erb'), + content => template('openstack_project/infra_lp_creds.erb'), replace => true, require => User['gerrit2'], } diff --git a/modules/openstack_project/templates/gerrit_lp_creds.erb b/modules/openstack_project/templates/gerrit_lp_creds.erb deleted file mode 100644 index bc996973aa..0000000000 --- a/modules/openstack_project/templates/gerrit_lp_creds.erb +++ /dev/null @@ -1,6 +0,0 @@ -[1] -consumer_key = <%= lp_sync_consumer_key %> -consumer_secret = -access_token = <%= lp_sync_token %> -access_secret = <%= lp_sync_secret %> - diff --git a/modules/openstack_project/templates/infra_lp_creds.erb b/modules/openstack_project/templates/infra_lp_creds.erb new file mode 100644 index 0000000000..750f2e396c --- /dev/null +++ b/modules/openstack_project/templates/infra_lp_creds.erb @@ -0,0 +1,5 @@ +[1] +access_token = <%= lp_access_token %> +access_secret = <%= lp_access_secret %> +consumer_key = <%= lp_consumer_key %> +consumer_secret =