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

Add a feature to make gitlab-runner member of docker group #150

Closed
gdubicki opened this issue Jul 14, 2017 · 2 comments
Closed

Add a feature to make gitlab-runner member of docker group #150

gdubicki opened this issue Jul 14, 2017 · 2 comments
Labels
enhancement New feature or request

Comments

@gdubicki
Copy link
Member

Pleae make this module optionally do step 4. from https://docs.gitlab.com/ce/ci/docker/using_docker_build.html#use-shell-executor in case you want to use the runner for building Docker images.

You can do it with a hacky-but-working:

exec {'add gitlab-runner to docker group':
    command => '/sbin/usermod -aG docker gitlab-runner',
    unless  => '/bin/grep -q "docker\\S*gitlab-runner" /etc/group',
}
@juniorsysadmin juniorsysadmin added the enhancement New feature or request label Jan 29, 2018
@mjburling
Copy link

You can do it with a hacky-but-working

I don't think it's all that bad. It's at least idempotent, right?

I've been on the look out for circumstances where a virtual resource would be an acceptable solution. Would this qualify:

@user {'gitlab-runner':
  groups  => ["docker"],
}

For now, I've just added it to my gitlabci-docker role's hiera:

docker::docker_users:
  - gitlab-runner

And I don't think the resource generated here is all that different from what you've suggested above:

# from /opt/puppetlabs/puppet/cache/state/resources.txt
[...]
exec[/usr/sbin/usermod -aG docker gitlab-runner]
[...]

@LongLiveCHIEF
Copy link
Contributor

I'm going to migrate this issue to the new https://github.com/voxpupuli/puppet-gitlab-ci-runner project. The next major release of this module will remove all gitlab runner functionality into that new module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants