Add launchpadlib credentials to gerrit ansible
Gerrit needs to be able to update bugs on launchpad. For that we need credentials. Change-Id: I967ee8715e03298a2ab021f37e17dc5fbde6fee6
This commit is contained in:
parent
1d37be64b4
commit
0a208bd1a9
@ -14,3 +14,4 @@ services:
|
||||
- /home/gerrit2/review_site/index:/var/gerrit/index
|
||||
- /home/gerrit2/review_site/logs:/var/log/gerrit
|
||||
- /home/gerrit2/review_site/static:/var/gerrit/static
|
||||
- /home/gerrit2/.launchpadlib:/var/gerrit/.launchpadlib
|
||||
|
@ -98,6 +98,25 @@
|
||||
mode: 0644
|
||||
when: welcome_message_gerrit_ssh_public_key is defined
|
||||
|
||||
# Make the directory even if we don't have creds to make
|
||||
# bind mounting in the docker-compose file simple.
|
||||
- name: Ensure launchpadlib directory exists
|
||||
file:
|
||||
state: directory
|
||||
path: "{{ gerrit_home_dir }}/.launchpadlib"
|
||||
owner: "{{ gerrit_user_name }}"
|
||||
group: "{{ gerrit_user_name }}"
|
||||
mode: 0775
|
||||
|
||||
- name: Write Launchpad creds file
|
||||
template:
|
||||
src: infra_lp_creds.j2
|
||||
dest: "{{ gerrit_home_dir }}/.launchpadlib/creds"
|
||||
owner: "{{ gerrit_user_name }}"
|
||||
group: "{{ gerrit_user_name }}"
|
||||
mode: 0600
|
||||
when: lp_access_token is defined
|
||||
|
||||
- name: Copy static hooks
|
||||
copy:
|
||||
src: "hooks/{{ item }}"
|
||||
|
5
playbooks/roles/gerrit/templates/infra_lp_creds.j2
Normal file
5
playbooks/roles/gerrit/templates/infra_lp_creds.j2
Normal file
@ -0,0 +1,5 @@
|
||||
[1]
|
||||
access_token = {{ gerrit_lp_access_token }}
|
||||
access_secret = {{ gerrit_lp_access_secret }}
|
||||
consumer_key = {{ gerrit_lp_consumer_key }}
|
||||
consumer_secret =
|
@ -7,3 +7,6 @@
|
||||
gerrit_ssh_rsa_key_contents: "{{ gerrit_dev_ssh_rsa_key_contents }}"
|
||||
gerrit_ssh_rsa_pubkey_contents: "{{ gerrit_dev_ssh_rsa_pubkey_contents }}"
|
||||
gerrit_database_config_section: "{{ gerrit_dev_database_config_section }}"
|
||||
gerrit_lp_access_token: "{{ gerrit_dev_lp_access_token }}"
|
||||
gerrit_lp_access_secret: "{{ gerrit_dev_lp_access_secret }}"
|
||||
gerrit_lp_consumer_key: "{{ gerrit_dev_lp_consumer_key }}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user