Skip to content

Commit

Permalink
Adding automatic OS Detection, unsupported OS Failure, and APT Support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Francis J.. Van Wetering IV committed Jul 13, 2015
1 parent 5627009 commit a559df9
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 28 deletions.
19 changes: 13 additions & 6 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
class gitlab_ci_multi_runner (
#The package manager version to add the repository for - RPM or APT. Currently, only RPM is supported because it's the only system
#I have to test for.
$package_manager = 'rpm'
#TODO: Get $package_manager from environment, not from parameter.
) {
$package_manager = $::osfamily ? {
'redhat' => 'rpm',
'debian' => 'apt',
default => 'unknown',
}
if $package_manager == 'unknown' {
fail("Target Operating system (${operatingsystem}) not supported")
} elsif $package_manager == 'apt' {
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.
# This may need to be refactored to use "onlyif" tests instead of using "creates" when APT support is built out.
$repoLocation = $package_manager ? {
'rpm' => "/etc/yum.repos.d/runner_gitlab-ci-multi-runner.repo",
#TODO: Add repo Location for APT
'rpm' => "/etc/yum.repos.d/runner_gitlab-ci-multi-runner.repo",
'apt' => "/etc/apt/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.
Expand Down
52 changes: 30 additions & 22 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
{
"name": "frankiethekneeman-gitlab_ci_multi_runner",
"version": "0.1.0",
"author": "Francis J.. Van Wetering IV",
"license": "MIT",
"summary": "A Module to Install and register the Gitlab CI Multirunner.",
"source": "https://github.com/frankiethekneeman/puppet-gitlab-ci-multi-runner",
"project_page": "https://forge.puppetlabs.com/frankiethekneeman/gitlab-ci-multi-runner",
"issues_url": "https://github.com/frankiethekneeman/puppet-gitlab-ci-multi-runner/issues",
"tags": ["Gitlab", "CI", "MultiRunner", "Go"],
"operatingsystem_support": [
{
"operatingsystem":"RedHat",
"operatingsystemrelease":[ "5.0", "6.0" ]
},
{
"operatingsystem":"CentOS",
"operatingsystemrelease":[ "5.0", "6.0" ]
}
],
"dependencies": [
{ "name": "puppetlabs/stdlib", "version_requirement": ">=3.2.0 <5.0.0" }
]
"name": "frankiethekneeman-gitlab_ci_multi_runner",
"version": "0.1.1",
"author": "Francis J.. Van Wetering IV",
"license": "MIT",
"summary": "A Module to Install and register the Gitlab CI Multirunner.",
"source": "https://github.com/frankiethekneeman/puppet-gitlab-ci-multi-runner",
"project_page": "https://forge.puppetlabs.com/frankiethekneeman/gitlab-ci-multi-runner",
"issues_url": "https://github.com/frankiethekneeman/puppet-gitlab-ci-multi-runner/issues",
"tags": ["Gitlab", "CI", "MultiRunner", "Go"],
"operatingsystem_support": [
{
"operatingsystem":"RedHat",
"operatingsystemrelease":[ "5.0", "6.0" ]
}
, {
"operatingsystem":"CentOS",
"operatingsystemrelease":[ "5.0", "6.0" ]
}
, {
"operatingsystem":"Debian",
"operatingsystemrelease":[ "7.0", "8.0" ]
}
, {
"operatingsystem":"Ubuntu",
"operatingsystemrelease":[ "14.04", "14.10", "15.04" ]
}
]
, "dependencies": [
{ "name": "puppetlabs/stdlib", "version_requirement": ">=3.2.0 <5.0.0" }
]
}

0 comments on commit a559df9

Please sign in to comment.