Merge "Add roles for adding and removing launchpadlib credentials"

This commit is contained in:
Zuul 2017-08-31 14:49:03 +00:00 committed by Gerrit Code Review
commit b82189a282
5 changed files with 55 additions and 0 deletions

View File

@ -0,0 +1,20 @@
Add launchpadlib credentials and launchpadlib to a host
**Role Variables**
.. zuul:rolevar:: lp_creds
Complex argument which contains the information needed to log in
to Launchpad. It is expected that this argument comes from a `Secret`.
.. zuul:rolevar:: access_token
Launchpad access token
.. zuul:rolevar:: access_secret
Launchpad access secret
.. zuul:rolevar:: consumer_key
Launchpad consumer key

View File

@ -0,0 +1,16 @@
- name: Ensure launchpadlib directory
file:
path: ~/.launchpadlib
state: directory
- name: Write credentials
template:
path: ~/.launchpadlib/creds
mode: 0600
src: creds.j2
- name: Install launchpadlib
package:
name: python-launchpadlib
state: present
become: yes

View File

@ -0,0 +1,5 @@
[1]
access_token = {{ lp_creds.access_token }}
access_secret = {{ lp_creds.access_secret }}
consumer_key = {{ lp_creds.consumer_key }}
consumer_secret =

View File

@ -0,0 +1,7 @@
Remove launchpadlib credentials from a host
**Role Variables**
.. zuul:rolevar:: launchpadlib_credentials
Path to the file containing the credentials.

View File

@ -0,0 +1,7 @@
- name: Remove the launchpadlib credentials
command: shred ~/.launchpadlib/creds
- name: Remove launchpadlib directory
file:
path: ~/.launchpadlib
state: absent