summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorJeoffrey Bauvin <jeoffrey.bauvin.ext@boursorama.fr>2015-10-27 09:27:30 +0100
committerJeoffrey Bauvin <jeoffrey.bauvin.ext@boursorama.fr>2015-10-27 09:27:30 +0100
commita89c460e0f630d778513a3b07a33f150b79d2aae (patch)
treecbadc6732eff0914a8a8bf24646ac8e3789572fd /manifests
parentf6da3a0d9d3604f62021ef0936e3f4f12649d8c4 (diff)
Add runner
Diffstat (limited to 'manifests')
-rw-r--r--manifests/config.pp14
-rw-r--r--manifests/init.pp1
-rw-r--r--manifests/install.pp1
-rw-r--r--manifests/params.pp1
-rw-r--r--manifests/repo/apt.pp2
-rw-r--r--manifests/runner.pp47
6 files changed, 63 insertions, 3 deletions
diff --git a/manifests/config.pp b/manifests/config.pp
index 65b0932..5cf7525 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -4,14 +4,22 @@
#
class gitlab_ci_multi_runner::config (
$concurrent = $gitlab_ci_multi_runner::concurrent,
+ $runners = $gitlab_ci_multi_runner::runners,
) {
-
- file { $::gitlab_ci_multi_runner::config_file:
+
+ concat { $::gitlab_ci_multi_runner::config_file:
ensure => present,
owner => $::gitlab_ci_multi_runner::user,
group => $::gitlab_ci_multi_runner::group,
- content => template('gitlab_ci_multi_runner/config.toml.erb'),
require => Package[$gitlab_ci_multi_runner::package_name],
notify => Service[$gitlab_ci_multi_runner::service_name],
}
+
+ concat::fragment { "header_$::gitlab_ci_multi_runner::config_file":
+ target => $::gitlab_ci_multi_runner::config_file,
+ content => template('gitlab_ci_multi_runner/fragment_header_config.toml.erb'),
+ order => '01',
+ }
+
+ create_resources(gitlab_ci_multi_runner::runner, $runners)
}
diff --git a/manifests/init.pp b/manifests/init.pp
index 9842027..77dcf73 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -23,6 +23,7 @@ class gitlab_ci_multi_runner (
$user = $gitlab_ci_multi_runner::params::user,
$group = $gitlab_ci_multi_runner::params::group,
$concurrent = $gitlab_ci_multi_runner::params::concurrent,
+ $runners = $gitlab_ci_multi_runner::params::runners,
) inherits gitlab_ci_multi_runner::params {
# validate parameters here
diff --git a/manifests/install.pp b/manifests/install.pp
index 998f7fb..128b5a1 100644
--- a/manifests/install.pp
+++ b/manifests/install.pp
@@ -11,5 +11,6 @@ class gitlab_ci_multi_runner::install {
package { $gitlab_ci_multi_runner::package_name:
ensure => present,
+ tag => 'gitlab-ci-multi-runner',
}
}
diff --git a/manifests/params.pp b/manifests/params.pp
index 4f25f62..8913977 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -11,6 +11,7 @@ class gitlab_ci_multi_runner::params {
$group = 'gitlab-runner'
$concurrent = 1
+ $runnners = undef
case $::osfamily {
'Debian': {
diff --git a/manifests/repo/apt.pp b/manifests/repo/apt.pp
index 123d06d..af7b073 100644
--- a/manifests/repo/apt.pp
+++ b/manifests/repo/apt.pp
@@ -19,4 +19,6 @@ class gitlab_ci_multi_runner::repo::apt {
'deb' => true,
},
}
+
+ Apt::Source['gitlab-ci-multi-runner']->Package<|tag == 'gitlab-ci-multi-runner'|>
} \ No newline at end of file
diff --git a/manifests/runner.pp b/manifests/runner.pp
new file mode 100644
index 0000000..f14cd06
--- /dev/null
+++ b/manifests/runner.pp
@@ -0,0 +1,47 @@
+# == Class gitlab_ci_multi_runner::runner
+#
+# Class for creating runners in multi-runner's config file.
+#
+# [*url*] - CI URL
+# Defaults to http://gitlab.example.com
+# [*token*] - runner token
+# Defaults to 'XXXX'
+# [*limit*] - limit how many jobs can be handled concurrently by this token. 0 simply means don't limit
+# Defaults to undef
+# [*shell*] - the name of shell to generate the script (default value is platform dependent) (bash, cmd, powershell)
+# Defaults to undef
+# [*executor*] - select how a project should be built (shell, docker, docker-ssh, ssh, parallels)
+# Defaults to shell
+# [*builds_dir*] - directory where builds will be stored in context of selected executor (Locally, Docker, SSH)
+# Defaults to undef
+# [*environment*] - append or overwrite environment variables
+# Defaults to undef
+# [*disable_verbose*] - don't print run commands
+# Defaults to undef
+# [*output_limit*] - set maximum build log size in kilobytes, by default set to 4096 (4MB)
+# Defaults to undef
+# [*docker_params*] - Docker params (image, allowed_images, allowed_services, volumes, ...). Need executor_docker to true.
+# Defaults to undef
+# [*config_file*] - Path for Gitlab Multi Runner config file
+# Default value in params.
+define gitlab_ci_multi_runner::runner (
+ $url = 'http://gitlab.example.com',
+ $token = 'XXXX',
+ $limit = undef,
+ $shell = undef,
+ $executor = 'shell',
+ $builds_dir = undef,
+ $environment = undef,
+ $disable_verbose = undef,
+ $output_limit = undef,
+ $docker_params = undef,
+ $parallels_params = undef,
+ $config_file = $gitlab_ci_multi_runner::params::config_file,
+){
+
+ concat::fragment { "${name}_$::gitlab_ci_multi_runner::config_file":
+ target => $::gitlab_ci_multi_runner::config_file,
+ content => template('gitlab_ci_multi_runner/fragment_runner_config.toml.erb'),
+ }
+
+} \ No newline at end of file