Skip to content

refactor!: remove manual registration of Gitlab Runner#388

Draft
kayman-mk wants to merge 41 commits into
cattle-ops:mainfrom
kayman-mk:kayma/register-runner-manually
Draft

refactor!: remove manual registration of Gitlab Runner#388
kayman-mk wants to merge 41 commits into
cattle-ops:mainfrom
kayman-mk:kayma/register-runner-manually

Conversation

@kayman-mk

@kayman-mk kayman-mk commented Oct 14, 2021

Copy link
Copy Markdown
Collaborator

Description

Removes the ability to register a Gitlab Runner manually (as described in #186) and pass the token into the module. This was done using secure_parameter_store_runner_token_key

It's now recommended to let the Gitlab Runner fetch the registration token from Gitlab and store it into a SSM parameter automatically.

If you use the secure_parameter_store_runner_token_key in the past: This SSM parameter is destroyed for every runner agent and a new one is created which is managed by the module. This means that new runners will register with Gitlab again.

Another way to get the token is the gitlabhq/gitlab provider. Check the data sources gitlab_group and gitlab_project. It does not work for instance runners as there is no data source available.

data "gitlab_group" "my_group" {
  group_id = 4711
}

# data.gitlab_group.my_group.runners_token contains the token

Closes #186

Migrations required

  • secure_parameter_store_runner_token_key
  • clean up the runner list in Gitlab (Settings > CI/CD > Runners) as all Runners will register again.

Verification

Deployed the new version of the module into our production environment and ran some build jobs. Worked fine.

ToDo

  • Update README.md and describe where to store the token

@kayman-mk kayman-mk marked this pull request as ready for review October 14, 2021 18:32
@npalm

npalm commented Oct 19, 2021

Copy link
Copy Markdown
Collaborator

@kayman-mk need a bit more time for this PR. I am happy to drop this really old feature.

Comment thread README.md Outdated
@npalm

npalm commented Nov 10, 2021

Copy link
Copy Markdown
Collaborator

On my list!

@kayman-mk kayman-mk changed the title Remove manual registration of Gitlab Runner refactor!: Remove manual registration of Gitlab Runner Nov 13, 2021
@npalm

npalm commented Nov 13, 2021

Copy link
Copy Markdown
Collaborator

@kayman-mk can you rebase this PR, will check this early next week. So I can release all breaking changes at once.

@npalm

npalm commented Nov 13, 2021

Copy link
Copy Markdown
Collaborator

thx

@kayman-mk kayman-mk closed this Nov 13, 2021
@kayman-mk kayman-mk force-pushed the kayma/register-runner-manually branch from 99195e5 to 9767603 Compare November 13, 2021 13:01
@kayman-mk kayman-mk deleted the kayma/register-runner-manually branch November 13, 2021 13:05

@npalm npalm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and looks good to me, one small remark.

Comment thread locals.tf
Comment thread README.md Outdated
Comment thread README.md Outdated
@kayman-mk

Copy link
Copy Markdown
Collaborator Author

@npalm Everything fixed.

@kayman-mk

Copy link
Copy Markdown
Collaborator Author

@npalm What about this PR?

@npalm

npalm commented Dec 5, 2022

Copy link
Copy Markdown
Collaborator

@npalm What about this PR?

Goinng to dig in.

@kayman-mk kayman-mk changed the base branch from develop to main January 1, 2023 12:22
@tmeijn

tmeijn commented Feb 25, 2023

Copy link
Copy Markdown
Contributor

@kayman-mk, maybe we could also suggest users to use the GitLab Terraform Provider to obtain their registration token?

Way I'm using the module right now:

image

image

This would not work however for instance runners since there is no API. Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/16319

@kayman-mk kayman-mk changed the title refactor!: Remove manual registration of Gitlab Runner refactor!: remove manual registration of Gitlab Runner Feb 26, 2023
@kayman-mk kayman-mk requested a review from npalm March 2, 2023 15:25
@kayman-mk kayman-mk changed the title refactor!: remove manual registration of Gitlab Runner refactor: remove manual registration of Gitlab Runner Mar 2, 2023
@kayman-mk kayman-mk changed the title refactor: remove manual registration of Gitlab Runner refactor!: remove manual registration of Gitlab Runner Mar 2, 2023
@kayman-mk kayman-mk marked this pull request as draft March 2, 2023 15:31
@github-actions github-actions Bot added the stale Issue/PR is stale and closed automatically label May 2, 2023
@kayman-mk kayman-mk removed the stale Issue/PR is stale and closed automatically label May 3, 2023
@github-actions github-actions Bot added the stale Issue/PR is stale and closed automatically label Jul 3, 2023
@kayman-mk kayman-mk removed the stale Issue/PR is stale and closed automatically label Jul 6, 2023
@github-actions github-actions Bot added the stale Issue/PR is stale and closed automatically label Nov 7, 2023
@kayman-mk kayman-mk added work-in-progress Issue/PR is worked, should not become stale and removed stale Issue/PR is stale and closed automatically labels Nov 7, 2023
@cattle-ops cattle-ops deleted a comment from github-actions Bot Nov 13, 2023
@cattle-ops cattle-ops deleted a comment from github-actions Bot Nov 13, 2023
@cattle-ops cattle-ops deleted a comment from github-actions Bot Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

work-in-progress Issue/PR is worked, should not become stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove the support for register the runner outside the module

4 participants