From 3f61ba8a16d4ef1db6478a5600dc404e637d3a59 Mon Sep 17 00:00:00 2001 From: Rafael Chicoli Date: Thu, 28 Jan 2016 20:04:44 +0100 Subject: add tls_skip_verify parameter --- manifests/runner.pp | 1 + templates/fragment_runner_config.toml.erb | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/manifests/runner.pp b/manifests/runner.pp index 2af8271..3877a0c 100644 --- a/manifests/runner.pp +++ b/manifests/runner.pp @@ -62,6 +62,7 @@ define gitlab_ci_multi_runner::runner ( $docker_params = undef, $parallels_params = undef, $config_file = $gitlab_ci_multi_runner::params::config_file, + $tls_skip_verify = undef, ){ concat::fragment { "${name}_${gitlab_ci_multi_runner::config_file}": diff --git a/templates/fragment_runner_config.toml.erb b/templates/fragment_runner_config.toml.erb index a9c3ca3..6735c6a 100644 --- a/templates/fragment_runner_config.toml.erb +++ b/templates/fragment_runner_config.toml.erb @@ -26,6 +26,9 @@ <% if @output_limit -%> output_limit = <%= @output_limit %> <% end -%> +<% if @tls_skip_verify -%> + tls_skip_verify = <%= @tls_skip_verify %> +<% end -%> <% if executor == 'docker' -%> [runners.docker] <%- if @docker_params['host'] -%> @@ -92,4 +95,4 @@ <%- if @ssh_params['identity_file'] -%> identity_file = "<%= @ssh_params['identity_file'] %>" <%- end -%> -<% end -%> \ No newline at end of file +<% end -%> -- cgit v1.2.3 From f025aeebe56924ac3393c79c4cfacd0389f14b36 Mon Sep 17 00:00:00 2001 From: Rafael Chicoli Date: Thu, 28 Jan 2016 20:05:47 +0100 Subject: add tls_ca_file parameter --- manifests/runner.pp | 1 + templates/fragment_runner_config.toml.erb | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/manifests/runner.pp b/manifests/runner.pp index 3877a0c..5e204d8 100644 --- a/manifests/runner.pp +++ b/manifests/runner.pp @@ -63,6 +63,7 @@ define gitlab_ci_multi_runner::runner ( $parallels_params = undef, $config_file = $gitlab_ci_multi_runner::params::config_file, $tls_skip_verify = undef, + $tls_ca_file = undef, ){ concat::fragment { "${name}_${gitlab_ci_multi_runner::config_file}": diff --git a/templates/fragment_runner_config.toml.erb b/templates/fragment_runner_config.toml.erb index 6735c6a..092e37d 100644 --- a/templates/fragment_runner_config.toml.erb +++ b/templates/fragment_runner_config.toml.erb @@ -1,6 +1,8 @@ [[runners]] +<% if @name -%> name = "<%= @name %>" +<% end -%> executor = "<%= @executor %>" <% if @url -%> url = "<%= @url %>" @@ -29,6 +31,9 @@ <% if @tls_skip_verify -%> tls_skip_verify = <%= @tls_skip_verify %> <% end -%> +<% if @tls_ca_file -%> + tls_ca_file = "<%= @tls_ca_file %>" +<% end -%> <% if executor == 'docker' -%> [runners.docker] <%- if @docker_params['host'] -%> -- cgit v1.2.3 From 5c1fd200344fecdb3e4c79de11792d6a79df098a Mon Sep 17 00:00:00 2001 From: Rafael Chicoli Date: Thu, 28 Jan 2016 20:54:56 +0100 Subject: add missing ssh_params --- manifests/runner.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/runner.pp b/manifests/runner.pp index 5e204d8..1ec3e82 100644 --- a/manifests/runner.pp +++ b/manifests/runner.pp @@ -60,6 +60,7 @@ define gitlab_ci_multi_runner::runner ( $disable_verbose = undef, $output_limit = undef, $docker_params = undef, + $ssh_params = undef, $parallels_params = undef, $config_file = $gitlab_ci_multi_runner::params::config_file, $tls_skip_verify = undef, -- cgit v1.2.3 From 30215b4afecbeb591fc3c66cd5be9fc2f59fc54d Mon Sep 17 00:00:00 2001 From: Rafael Chicoli Date: Thu, 28 Jan 2016 20:57:56 +0100 Subject: move create_ressources runners to init file --- manifests/config.pp | 3 --- manifests/init.pp | 6 +++++- manifests/params.pp | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index c8a6fbd..fec0ac2 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -21,7 +21,4 @@ class gitlab_ci_multi_runner::config ( order => '01', } - if $gitlab_ci_multi_runner::runners { - create_resources(gitlab_ci_multi_runner::runner, $runners) - } } diff --git a/manifests/init.pp b/manifests/init.pp index 1670d98..cd39308 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -45,7 +45,11 @@ class gitlab_ci_multi_runner ( $config_file = $gitlab_ci_multi_runner::params::config_file, ) inherits gitlab_ci_multi_runner::params { - # validate parameters here + validate_hash($gitlab_ci_multi_runner::runners) + + if $gitlab_ci_multi_runner::runners { + create_resources(gitlab_ci_multi_runner::runner, $runners) + } anchor { 'before_gitlab_ci_multi_runner': } -> class { 'gitlab_ci_multi_runner::install': } -> diff --git a/manifests/params.pp b/manifests/params.pp index d883d12..5a18d34 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -10,7 +10,7 @@ class gitlab_ci_multi_runner::params { $group = 'gitlab-runner' $concurrent = 1 - $runners = undef + $runners = {} $service_ensure = true $service_start = '/usr/bin/gitlab-ci-multi-runner start' -- cgit v1.2.3 From 2bc9d47add521d78f8ade7ff5de36b77104d0371 Mon Sep 17 00:00:00 2001 From: Rafael Chicoli Date: Thu, 28 Jan 2016 21:10:58 +0100 Subject: update README usage section --- README.markdown | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/README.markdown b/README.markdown index f0bb736..7434c2d 100644 --- a/README.markdown +++ b/README.markdown @@ -37,13 +37,33 @@ If your module requires anything extra before setting up (pluginsync enabled, et ###Beginning with gitlab_ci_multi_runner -The very basic steps needed for a user to get the module up and running. +To use the gitlab_ci_multi_runner with default parameters, declare the ```gitlab_ci_multi_runner``` class. -If your most recent release breaks compatibility or requires particular steps for upgrading, you may wish to include an additional section here: Upgrading (For an example, see http://forge.puppetlabs.com/puppetlabs/firewall). +```puppet +include gitlab_ci_multi_runner +``` + +**Note:** The main gitlab_ci_multi_runner class is required by all other classes, types, and defines in this module. You must declare it whenever you use the module. ##Usage -Put the classes, types, and resources for customizing, configuring, and doing the fancy stuff with your module here. +### Hiera + +```hiera +gitlab_ci_multi_runner::runners: + 'host01-ssh': + url: 'https://gitlab.example.com/ci' + token: 'abb0d7b09e8491ccc6a0d4264fc319ca' + tls_skip_verify: true + tls_ca_file: '/usr/local/share/ca-certificates/ca.crt' + executor: 'ssh' + ssh_params: + host: "%{::fqdn}" + port: '22' + user: 'gitlab-runner' + password: 'strongpassword' + identity_file: '' +``` ##Reference -- cgit v1.2.3