Skip to content

Commit

Permalink
on sles we must manage gitlab runner group and user
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxmea committed May 28, 2024
1 parent 95ee68f commit cac6872
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions data/family/Suse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
gitlab_ci_runner::install_method: 'binary'
gitlab_ci_runner::manage_repo: false
gitlab_ci_runner::manage_config_dir: true
gitlab_ci_runner::manage_user: true
9 changes: 9 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
# URL to the binary file
# @param binary_path
# Absolute path where to install gitlab_runner binary
# @param manage_user
# If the user should be managed.
# @param user
# The user to manage.
# @param group
# The group to manage.
# @param manage_repo
# If the repository should be managed.
# @param package_ensure
Expand Down Expand Up @@ -98,6 +104,9 @@
Enum['repo', 'binary'] $install_method = 'repo',
Stdlib::HTTPUrl $binary_source = 'https://s3.dualstack.us-east-1.amazonaws.com/gitlab-runner-downloads/latest/binaries/gitlab-runner-linux-amd64',
Stdlib::Absolutepath $binary_path = '/usr/local/bin/gitlab-runner',
Boolean $manage_user = false,
String[1] $user = 'gitlab-runner',
String[1] $group = $user,
Boolean $manage_docker = false,
Boolean $manage_repo = true,
String $package_ensure = installed,
Expand Down
9 changes: 9 additions & 0 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@
ensure => file,
mode => '0755',
}
if $gitlab_ci_runner::manage_user {
group { $gitlab_ci_runner::group:
ensure => present,
}
user { $gitlab_ci_runner::user:
ensure => present,
gid => $gitlab_ci_runner::group,
}
}
}
default: {
fail("Unsupported install method: ${gitlab_ci_runner::install_method}")
Expand Down

0 comments on commit cac6872

Please sign in to comment.