Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: remove manual registration of Gitlab Runner #388

Draft
wants to merge 41 commits into
base: main
Choose a base branch
from

Conversation

kayman-mk
Copy link
Collaborator

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

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
Copy link
Collaborator

npalm commented Oct 19, 2021

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

README.md Outdated Show resolved Hide resolved
@npalm
Copy link
Collaborator

npalm commented Nov 10, 2021

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
Copy link
Collaborator

npalm commented Nov 13, 2021

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

@npalm
Copy link
Collaborator

npalm commented Nov 13, 2021

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
Copy link
Collaborator

@npalm npalm left a comment

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.

locals.tf Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@kayman-mk
Copy link
Collaborator Author

@npalm Everything fixed.

@kayman-mk
Copy link
Collaborator Author

@npalm What about this PR?

@npalm
Copy link
Collaborator

npalm commented Dec 5, 2022

@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
Copy link
Contributor

tmeijn commented Feb 25, 2023

@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