Skip to content

Commit

Permalink
Merge pull request #1 from donoftime/deb-and-el7-enhancements
Browse files Browse the repository at this point in the history
Deb and el7 enhancements
  • Loading branch information
frankiethekneeman committed Aug 19, 2015
2 parents c3207f0 + cf49ce0 commit efcdf51
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 16 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ Installation takes place via the instructions found
[here](https://github.com/ayufan/gitlab-ci-multi-runner/blob/master/docs/install/linux-repository.md) - Repo is added,
User created and managed, and the Runners are registered.

The YUM version is hard set to v0.4.2 because 0.5.0 does not run well on CentOS Systems.
The version of the gitlab-ci-multi-runner package is restricted to `v0.4.2` for RHEL5 and RHEL6 derivatives due to
restrictions identified on CentOS systems. RHEL7 and Debian derivatives are set to use the most current release
available.

##Usage

Expand Down
36 changes: 24 additions & 12 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
class gitlab_ci_multi_runner (
) {
$package_manager = $::osfamily ? {
$package_type = $::osfamily ? {
'redhat' => 'rpm',
'debian' => 'apt',
'debian' => 'deb',
default => 'unknown',
}

if $package_manager == 'unknown' {
if $package_type == 'unknown' {
fail("Target Operating system (${operatingsystem}) not supported")
} elsif $package_manager == 'apt' {
} elsif $package_type == 'deb' {
warning("${operatingsystem} support is still in Beta - please report any issues to the main repository at https://github.com/frankiethekneeman/puppet-gitlab-ci-multi-runner/issues")
}

# Get the file created by the "repo adding" step.
$repoLocation = $package_manager ? {
$repoLocation = $package_type ? {
'rpm' => "/etc/yum.repos.d/runner_gitlab-ci-multi-runner.repo",
'apt' => "/etc/apt/sources.list.d/runner_gitlab-ci-multi-runner.list",
'deb' => "/etc/deb/sources.list.d/runner_gitlab-ci-multi-runner.list",
default => '/var',
# Choose a file that will definitely be there so that we don't have to worry about it running in the case
# of an unknown package_manager type.
}


$serviceFile = $package_type ? {
'rpm' => $::operatingsystemrelease ? {
/7.*/ => '/etc/systemd/system/gitlab-ci-multi-runner.service',
default => '/etc/init.d/gitlab-ci-multi-runner'
},
'deb' => '/etc/init/gitlab-runner.conf',
default => '/bin/true'
}

$version = $::osfamily ? {
'redhat' => '0.4.2-1',
'redhat' => $::operatingsystemrelease ? {
/7.*/ => 'latest',
default => '0.4.2-1'
},
'debian' => 'installed',
default => 'There is no spoon',
}
Expand All @@ -35,9 +47,9 @@
ensure => "present",
managehome => "true",
} ->
# Add The repository to yum/apt-get
# Add The repository to yum/deb-get
exec {"Add Repository":
command => "curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.${package_manager}.sh | bash",
command => "curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.${package_type}.sh | bash",
user => root,
provider => shell,
creates => $repoLocation,
Expand All @@ -50,14 +62,14 @@
command => "gitlab-ci-multi-runner install",
user => root,
provider => shell,
creates => "/etc/init.d/gitlab-ci-multi-runner"
creates => $serviceFile,
} ->
# Ensure that the service is running at all times.
service { "gitlab-ci-multi-runner":
ensure => "running",
}

if $package_manager == 'rpm' {
if $package_type == 'rpm' {
exec { "Yum Exclude Line":
command => "echo exclude= >> /etc/yum.conf",
onlyif => "! grep '^exclude=' /etc/yum.conf",
Expand Down
10 changes: 7 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frankiethekneeman-gitlab_ci_multi_runner",
"version": "0.1.4",
"version": "0.1.5",
"author": "Francis J.. Van Wetering IV",
"license": "MIT",
"summary": "A Module to Install and register the Gitlab CI Multirunner.",
Expand All @@ -11,11 +11,15 @@
"operatingsystem_support": [
{
"operatingsystem":"RedHat",
"operatingsystemrelease":[ "5.0", "6.0" ]
"operatingsystemrelease":[ "5.0", "6.0", "7.0" ]
}
, {
"operatingsystem":"CentOS",
"operatingsystemrelease":[ "5.0", "6.0" ]
"operatingsystemrelease":[ "5.0", "6.0", "7.0" ]
}
, {
"operatingsystem":"OracleLinux",
"operatingsystemrelease":[ "5.0", "6.0", "7.0" ]
}
, {
"operatingsystem":"Debian",
Expand Down

0 comments on commit efcdf51

Please sign in to comment.