Runner configuration with runner token

I’m in the process of trying to move from authentication tokens for runners to registration tokens.
However it seems all the command line flags that are specified are no longer supported?

As an example here is my sanitised runner command:
I am deploying via terraform .tftpl file hence the if commands.

# Register GitLab Runner
sudo gitlab-runner --log-level debug register --url ${host} \
    --registration-token ${registration_token} \
    --description ${name}-runner \
    %{ if run_untagged }--run-untagged%{ endif } \
    %{ if tags != "" }--tag-list ${tags}%{ endif } \
    --executor docker+machine \
    --docker-image docker:latest \
    --locked=false \
    --non-interactive \
    --docker-privileged \
    --cache-type s3 \
    --cache-shared \
    --cache-s3-server-address \
    --cache-s3-access-key ${access_key} \
    --cache-s3-secret-key ${secret_key} \
    --cache-s3-bucket-name ${s3_bucket} \
    --cache-s3-bucket-location ${region} \
    --machine-idle-nodes 0 \
    --machine-idle-time 900 \
    --machine-max-builds 10 \
    --machine-machine-driver amazonec2 \
    --machine-machine-name machine-${name}-%s \
    --machine-machine-options "amazonec2-access-key=${access_key}" \
    --machine-machine-options "amazonec2-secret-key=${secret_key}" \
    --machine-machine-options "amazonec2-region=${region}" \
    --machine-machine-options "amazonec2-vpc-id=${vpc}" \
    --machine-machine-options "amazonec2-subnet-id=${subnet}" \
    --machine-machine-options "amazonec2-zone=a" \
    --machine-machine-options "amazonec2-use-private-address=true" \
    --machine-machine-options "amazonec2-tags=runner-manager-name,gitlab-runner-manager-ec2-${name},gitlab,true,gitlab-runner-autoscale,true" \
    --machine-machine-options "amazonec2-iam-instance-profile=AmazonSSMManagedInstanceCore" \
    --machine-machine-options "amazonec2-security-group=${security_group}" \
    --machine-machine-options "amazonec2-ami=${runner_ami}" \
    --machine-machine-options "amazonec2-root-size=${root_partition_size}" \
    --machine-machine-options "amazonec2-instance-type=${instance_type}" \
    --machine-machine-options "amazonec2-request-spot-instance=true" \
    --machine-machine-options "amazonec2-spot-price=" \
    --machine-machine-options "amazonec2-keypair-name=gitlab-runner-ec2" \
    --machine-machine-options "amazonec2-ssh-keypath=/etc/gitlab-runner/gitlab-runner" \
    --machine-machine-options "amazonec2-userdata=/etc/gitlab-runner/" \
    --output-limit 16384

Now when running this command I get the following error:

ESC[31;1mFATAL: Runner configuration other than name and executor configuration is reserved and cannot be specified when registering with a runner token. This configuration is specified on the GitLab server. Please try again without specifying those arguments.ESC[0;m

What exactly does this mean? Can I only specify a name & executor flag? How do I specify all the other options as these are not all available when creating a runner on gitlab.


1 Like