gerrit: fix Launchpad credentials write

The extant variable name is never set so this never writes anything
out.  Move it to a dictionary value.  Use stub values for testing,
this way we don't need the "when:".

Additionally remove an unused old template file.

Change-Id: Id96fde79e28f309aa13e16bdda29f004c3c69c4b
This commit is contained in:
Ian Wienand 2021-07-19 14:05:58 +10:00
parent cf7c95acb1
commit 21e25cb4f6
4 changed files with 9 additions and 9 deletions

View File

@ -1,5 +0,0 @@
[1]
access_token = <%= @lp_access_token %>
access_secret = <%= @lp_access_secret %>
consumer_key = <%= @lp_consumer_key %>
consumer_secret =

View File

@ -185,6 +185,8 @@
group: "{{ gerrit_user_name }}" group: "{{ gerrit_user_name }}"
mode: 0775 mode: 0775
# The hook scripts below use update-bug (provided by jeepyb) and this
# authentication file.
- name: Write Launchpad creds file - name: Write Launchpad creds file
template: template:
src: infra_lp_creds.j2 src: infra_lp_creds.j2
@ -192,7 +194,6 @@
owner: "{{ gerrit_user_name }}" owner: "{{ gerrit_user_name }}"
group: "{{ gerrit_user_name }}" group: "{{ gerrit_user_name }}"
mode: 0600 mode: 0600
when: lp_access_token is defined
- name: Copy static hooks - name: Copy static hooks
copy: copy:

View File

@ -1,5 +1,5 @@
[1] [1]
access_token = {{ gerrit_lp_access_token }} access_token = {{ gerrit_launchpad_auth['access_token'] }}
access_secret = {{ gerrit_lp_access_secret }} access_secret = {{ gerrit_launchpad_auth['access_secret'] }}
consumer_key = {{ gerrit_lp_consumer_key }} consumer_key = {{ gerrit_launchpad_auth['consumer_key'] }}
consumer_secret = consumer_secret =

View File

@ -100,3 +100,7 @@ gerrit_email_private_key: wjpkxebohgbid6rpuwpfrYsouxpgseluqir6yupppBczoezj
gerrit_rest_token_private_key: A83fAC8x72wxcu gerrit_rest_token_private_key: A83fAC8x72wxcu
gerrit_container_image: "docker.io/opendevorg/gerrit:{{ zuul_test_gerrit_version | default('3.2') }}" gerrit_container_image: "docker.io/opendevorg/gerrit:{{ zuul_test_gerrit_version | default('3.2') }}"
gerrit_under_test: true gerrit_under_test: true
gerrit_launchpad_auth:
access_token: 'token'
access_secret: 'secret'
consumer_key: 'consumer_key'