Page MenuHomePhabricator

Automatically manage repos/stewards group in Gitlab
Closed, ResolvedPublic

Description

Wikimedia Stewards have repos/stewards group in GitLab. Let's manage it automatically from the Stewards-Onboarding-Tool, to ensure all stewards have access to it.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change #1050731 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[operations/puppet@production] stewards-onboarder: Add gitlab API to config

https://gerrit.wikimedia.org/r/1050731

@Dzahn Can you help me with the secrets management here, please? I put the token at stewards1001:/home/urbanecm/gitlab_settings.yaml.

I'll do that on Monday. No problem. Also see comments on the gerrit patch.

I added the token in the private hieradata under role/common/stewards with the key profile::stewards::gitlab_api_token.

This means you can now do a:

String $gitlab_api_token = lookup('profile::stewards::gitlab_api_token,... in profile::stewards next to the existing lookups from public hieradata and have the secret value in the variable.

If you have to get it into the yaml written on disk you will then have to turn it from a file to a template (.erb) where we create the steward-onboarder.yaml and then you can use class variables in there.

@Dzahn Thank you! I tried following your instructions in https://gerrit.wikimedia.org/r/c/operations/puppet/+/1050731, looks like it works. Review appreciated (but definitely can wait for Monday :)).

LSobanski triaged this task as Medium priority.
LSobanski updated Other Assignee, added: Urbanecm.
LSobanski moved this task from Incoming to Work in Progress on the collaboration-services board.

Change #1050731 merged by Dzahn:

[operations/puppet@production] stewards-onboarder: Add gitlab API to config

https://gerrit.wikimedia.org/r/1050731

puppet wrote /etc/steward-onboarder/steward-onboarder.yaml on stewards1001 just fine

[urbanecm@stewards1001 /srv/repos/onboarding-system (main|u=)]$ python3 onboarder.py update
== Updating gitlab_group
INFO:root:Skipping urbanecm, their access level is not managed.
INFO:root:Removing urbanecmtest from repos/stewards, no longer authorised
== Updating ldap_group
== Updating mailman_list
[urbanecm@stewards1001 /srv/repos/onboarding-system (main|u=)]$

and reading it works as well!

Closing :).