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
576 stars 326 forks source link

pre_install_script and post_install_script for workers #1150

Open dsalaza4 opened 1 month ago

dsalaza4 commented 1 month 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 1 month ago

Good point. This might also be helpful for #1118

kayman-mk commented 1 month ago

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

dsalaza4 commented 1 month 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 1 month 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