Skip to content

Commit

Permalink
Update cli
Browse files Browse the repository at this point in the history
  • Loading branch information
Joris29 committed Jan 16, 2024
1 parent 8692e3c commit ee407c2
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 2 deletions.
47 changes: 45 additions & 2 deletions manifests/cli.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,47 @@
# @summary This class is used to manage cli resources.
# @summary Class to manage installation and configuration of Rundeck CLI.
#
# @example Use cli with token and project config.
# class { 'rundeck::cli':
# manage_repo => false,
# url => 'https://rundeck01.example.com',
# bypass_url => 'https://rundeck.example.com',
# token => 'very_secure',
# projects => {
# 'MyProject' => {
# 'update_method' => 'set',
# 'config' => {
# 'project.description' => 'This is My rundeck project',
# 'project.disable.executions' => 'false',
# },
# },
# 'TestProject' => {
# 'config' => {
# 'project.description' => 'This is a rundeck test project',
# 'project.disable.schedule' => 'false',
# },
# },
# },
# }
#
# @param repo_config
# A hash of repository attributes for configuring the rundeck cli package repositories.
# Examples/defaults for yumrepo can be found at RedHat.yaml, and for apt at Debian.yaml
# @param manage_repo
# Whether to manage the cli package repository.
# @param version
# Ensure the state of the rundeck cli package, either present, absent or a specific version.
# @param url
# Rundeck instance/api url.
# @param bypass_url
# Rundeck external url to bypass. This will rewrite any redirect to $bypass_url as $url
# @param user
# Cli user to authenticate.
# @param password
# Cli password to authenticate.
# @param token
# Cli token to authenticate.
# @param projects
# Cli projects config. See example for structure and rundeck::config::project for available params.
#
class rundeck::cli (
Hash $repo_config,
Expand All @@ -9,7 +52,7 @@
String[1] $user = 'admin',
String[1] $password = 'admin',
Optional[String[8]] $token = undef,
Hash $projects = {},
Hash[String, Rundeck::Project] $projects = {},
) {
ensure_resource('package', 'jq', { 'ensure' => 'present' })

Expand Down
5 changes: 5 additions & 0 deletions types/project.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Rundeck project config type.
type Rundeck::Project = Struct[{
Optional['config'] => Hash[String, String],
Optional['update_method'] => String,
}]

0 comments on commit ee407c2

Please sign in to comment.