An issue I ran into when creating a new Gitlab repo with terraform

Gitlab + Terraform

I try to manage my gitlab repos via terraform lately.

Yesterday, I created a new project called ansible-role-chrome.

This was done with terraform.

The project has a gitlabci file that runs molecule test in two Debian 9&10 images of mine.

Today I got an email saying that my CI failed on this new repo, whereas I had molecule tests working locally.

I found out that when creating the repo with terraform apply, shared runners were disabled for this repo.

After looking at the gitlab project resource docs, I saw there's a shared_runners_enabled argument.

My resource block of course didn't contain the following line:

shared_runners_enabled = true

The whole block now looks like this:

resource "gitlab_project" "ansible-role-chrome" {
    name = "ansible-role-chrome"
    description = "this is the ansible-role-chrome repo"
    visibility_level = "public"
    request_access_enabled = false
    default_branch = "master"
    merge_requests_enabled = true
    issues_enabled = true
    wiki_enabled = false
    shared_runners_enabled = true
}

So now I've got shared runners enabled for this project and now of course my molecule tests passed. Yay.

links

social