From 9e34914cc75d5c8199538abcae59a486a2282eb3 Mon Sep 17 00:00:00 2001 From: Jeoffrey Bauvin Date: Mon, 26 Oct 2015 11:52:35 +0100 Subject: Add skeleton --- manifests/config.pp | 6 ++++++ manifests/init.pp | 21 +++++++++++++++++++++ manifests/install.pp | 8 ++++++++ manifests/params.pp | 20 ++++++++++++++++++++ manifests/service.pp | 14 ++++++++++++++ 5 files changed, 69 insertions(+) create mode 100644 manifests/config.pp create mode 100644 manifests/init.pp create mode 100644 manifests/install.pp create mode 100644 manifests/params.pp create mode 100644 manifests/service.pp (limited to 'manifests') diff --git a/manifests/config.pp b/manifests/config.pp new file mode 100644 index 0000000..f3c3f6c --- /dev/null +++ b/manifests/config.pp @@ -0,0 +1,6 @@ +# == Class gitlab_ci_multi_runner::config +# +# This class is called from gitlab_ci_multi_runner +# +class gitlab_ci_multi_runner::config { +} diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..c0475a5 --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,21 @@ +# == Class: gitlab_ci_multi_runner +# +# Full description of class gitlab_ci_multi_runner here. +# +# === Parameters +# +# [*sample_parameter*] +# Explanation of what this parameter affects and what it defaults to. +# +class gitlab_ci_multi_runner ( + $package_name = $gitlab_ci_multi_runner::params::package_name, + $service_name = $gitlab_ci_multi_runner::params::service_name, +) inherits gitlab_ci_multi_runner::params { + + # validate parameters here + + class { 'gitlab_ci_multi_runner::install': } -> + class { 'gitlab_ci_multi_runner::config': } ~> + class { 'gitlab_ci_multi_runner::service': } -> + Class['gitlab_ci_multi_runner'] +} diff --git a/manifests/install.pp b/manifests/install.pp new file mode 100644 index 0000000..9a1fed0 --- /dev/null +++ b/manifests/install.pp @@ -0,0 +1,8 @@ +# == Class gitlab_ci_multi_runner::install +# +class gitlab_ci_multi_runner::install { + + package { $gitlab_ci_multi_runner::package_name: + ensure => present, + } +} diff --git a/manifests/params.pp b/manifests/params.pp new file mode 100644 index 0000000..775c3ef --- /dev/null +++ b/manifests/params.pp @@ -0,0 +1,20 @@ +# == Class gitlab_ci_multi_runner::params +# +# This class is meant to be called from gitlab_ci_multi_runner +# It sets variables according to platform +# +class gitlab_ci_multi_runner::params { + case $::osfamily { + 'Debian': { + $package_name = 'gitlab_ci_multi_runner' + $service_name = 'gitlab_ci_multi_runner' + } + 'RedHat', 'Amazon': { + $package_name = 'gitlab_ci_multi_runner' + $service_name = 'gitlab_ci_multi_runner' + } + default: { + fail("${::operatingsystem} not supported") + } + } +} diff --git a/manifests/service.pp b/manifests/service.pp new file mode 100644 index 0000000..8ac2727 --- /dev/null +++ b/manifests/service.pp @@ -0,0 +1,14 @@ +# == Class gitlab_ci_multi_runner::service +# +# This class is meant to be called from gitlab_ci_multi_runner +# It ensure the service is running +# +class gitlab_ci_multi_runner::service { + + service { $gitlab_ci_multi_runner::service_name: + ensure => running, + enable => true, + hasstatus => true, + hasrestart => true, + } +} -- cgit v1.2.3