cattle-ops / terraform-aws-gitlab-runner

Terraform module for AWS GitLab runners on ec2 (spot) instances
https://registry.terraform.io/modules/cattle-ops/gitlab-runner/aws
MIT License
586 stars 331 forks source link

pre_install_script and post_install_script for workers #1150

Closed dsalaza4 closed 1 month ago

dsalaza4 commented 4 months ago

Describe the solution you'd like

Currently, runners support start_script, pre_install_script and post_install_script via runner_install parameter.

But it seems like workers only support start_script via runner_worker_docker_machine_instance parameter.

This makes it impossible to run commands on workers right before or after base setup.

Suggest a solution

Additional context

kayman-mk commented 4 months ago

Good point. This might also be helpful for #1118

kayman-mk commented 4 months ago

Not sure if this is possible. The start_script is used as user data script on the EC2 instance.

dsalaza4 commented 4 months ago

What's more important in my opinion is being able to prepend/append custom code to the worker user data.

If start_script is currently used, then I would advise only supporting pre_start_script and post_start_script so users can do whatever they want before or after that baseline configuration.

kayman-mk commented 3 months ago

Any idea how to add this? I can't find any option for the Fleeting plugin (docker+autoscaler) and the same goes for docker+machine

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days.

dsalaza4 commented 1 month ago

I did not have time to check this and ended up solving my specific necessity differently.

I think we can close this as it looks like no one actually has needed it so far! 🫶