Skip to content

Commit

Permalink
Merge pull request #178 from ScaleCommerce/unregister_runner
Browse files Browse the repository at this point in the history
Unregister runner
  • Loading branch information
LongLiveCHIEF authored May 26, 2018
2 parents 2a3ea7c + 0a34c8e commit 8008c95
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,19 @@ gitlab_ci_runners_defaults:
docker-image: "ubuntu:trusty"
```

To unregister a specific runner you may use `ensure` param:

```yaml
gitlab_ci_runners:
test_runner1:{}
test_runner2:{}
test_runner3:
url: "https://git.alternative.org/ci"
registration-token: "abcdef1234567890"
ensure: absent
```


### NGINX Configuration

Configuration of the embedded NGINX instance is handled by the `/etc/gitlab/gitlab.rb` file. Details on available configuration options are available at http://doc.gitlab.com/omnibus/settings/nginx.html. Options listed here can be passed in to the `nginx` parameter as a hash. For example, to enable ssh redirection:
Expand Down
18 changes: 13 additions & 5 deletions manifests/runner.pp
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,18 @@
$runner_name = $_config['name']
$toml_file = '/etc/gitlab-runner/config.toml'

# Execute gitlab ci multirunner register
exec {"Register_runner_${title}":
command => "/usr/bin/${binary} register -n ${parameters_string}",
unless => "/bin/grep ${runner_name} ${toml_file}",
}
if $_config['ensure'] == 'absent' {
# Execute gitlab ci multirunner unregister
exec {"Unregister_runner_${title}":
command => "/usr/bin/${binary} unregister -n ${title}",
onlyif => "/bin/grep ${runner_name} ${toml_file}",
}
} else {
# Execute gitlab ci multirunner register
exec {"Register_runner_${title}":
command => "/usr/bin/${binary} register -n ${parameters_string}",
unless => "/bin/grep ${runner_name} ${toml_file}",
}
}

}

0 comments on commit 8008c95

Please sign in to comment.