From ee407c207fab2155db619a395f1462321526bf51 Mon Sep 17 00:00:00 2001 From: Joris29 Date: Tue, 16 Jan 2024 07:48:43 +0100 Subject: [PATCH] Update cli --- manifests/cli.pp | 47 +++++++++++++++++++++++++++++++++++++++++++++-- types/project.pp | 5 +++++ 2 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 types/project.pp diff --git a/manifests/cli.pp b/manifests/cli.pp index 7ad775d7c..74aa8394e 100644 --- a/manifests/cli.pp +++ b/manifests/cli.pp @@ -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, @@ -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' }) diff --git a/types/project.pp b/types/project.pp new file mode 100644 index 000000000..493f9e279 --- /dev/null +++ b/types/project.pp @@ -0,0 +1,5 @@ +# Rundeck project config type. +type Rundeck::Project = Struct[{ + Optional['config'] => Hash[String, String], + Optional['update_method'] => String, +}]