Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webhook-go: Move static data from params to webhook class #628

Merged
merged 1 commit into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -584,15 +584,15 @@ Data type: `Boolean`



Default value: `$r10k::params::webhook_ensure`
Default value: `false`

##### <a name="-r10k--webhook--version"></a>`version`

Data type: `String`



Default value: `$r10k::params::webhook_version`
Default value: `'2.1.0'`

##### <a name="-r10k--webhook--service_ensure"></a>`service_ensure`

Expand All @@ -607,15 +607,15 @@ Variant[



Default value: `$r10k::params::webhook_service_ensure`
Default value: `'running'`

##### <a name="-r10k--webhook--service_enabled"></a>`service_enabled`

Data type: `Boolean`



Default value: `$r10k::params::webhook_service_enabled`
Default value: `true`

##### <a name="-r10k--webhook--config_ensure"></a>`config_ensure`

Expand Down Expand Up @@ -643,12 +643,12 @@ Default value:

```puppet
{
enabled => $r10k::params::webhook_chatops_enabled,
service => $r10k::params::webhook_chatops_service,
channel => $r10k::params::webhook_chatops_channel,
user => $r10k::params::webhook_chatops_user,
auth_token => $r10k::params::webhook_chatops_token,
server_uri => $r10k::params::webhook_chatops_uri,
enabled => false,
service => '',
channel => '',
user => '',
auth_token => '',
server_uri => '',
}
```

Expand All @@ -662,9 +662,9 @@ Default value:

```puppet
{
enabled => $r10k::params::webhook_tls_enabled,
certificate => $r10k::params::webhook_tls_cert_path,
key => $r10k::params::webhook_tls_key_path,
enabled => false,
certificate => undef,
key => undef,
}
```

Expand All @@ -678,10 +678,10 @@ Default value:

```puppet
{
protected => $r10k::params::webhook_protected,
user => $r10k::params::webhook_user,
password => $r10k::params::webhook_password,
port => $r10k::params::webhook_port,
protected => true,
user => 'puppet',
password => 'puppet',
port => 4000,
tls => $tls,
}
```
Expand All @@ -696,14 +696,14 @@ Default value:

```puppet
{
command_path => $r10k::params::webhook_r10k_command_path,
config_path => $r10k::params::webhook_r10k_config_path,
default_branch => $r10k::params::webhook_r10k_default_branch,
prefix => $r10k::params::webhook_r10k_branch_prefix,
allow_uppercase => $r10k::params::webhook_r10k_allow_uppercase,
verbose => $r10k::params::webhook_r10k_verbose,
deploy_modules => $r10k::params::webhook_r10k_deploy_modules,
generate_types => $r10k::params::webhook_r10k_generate_types,
command_path => '/opt/puppetlabs/puppet/bin/r10k',
config_path => '/etc/puppetlabs/r10k/r10k.yaml',
default_branch => 'production',
prefix => '',
allow_uppercase => false,
verbose => true,
deploy_modules => true,
generate_types => true,
}
```

Expand Down
27 changes: 0 additions & 27 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -60,31 +60,4 @@
$is_pe_server = false
$modulepath = "${r10k_basedir}/\$environment/modules"
}

# Webhook Go parameters
$webhook_ensure = false
$webhook_protected = true
$webhook_version = '2.1.0'
$webhook_user = 'puppet'
$webhook_password = 'puppet'
$webhook_port = 4000
$webhook_tls_enabled = false
$webhook_tls_cert_path = undef
$webhook_tls_key_path = undef
$webhook_chatops_enabled = false
$webhook_chatops_service = ''
$webhook_chatops_channel = ''
$webhook_chatops_user = ''
$webhook_chatops_token = ''
$webhook_chatops_uri = ''
$webhook_r10k_command_path = "/opt/puppetlabs/puppet/bin/${r10k_binary}"
$webhook_r10k_config_path = '/etc/puppetlabs/r10k/r10k.yaml'
$webhook_r10k_default_branch = 'production'
$webhook_r10k_branch_prefix = ''
$webhook_r10k_allow_uppercase = false
$webhook_r10k_verbose = true
$webhook_r10k_deploy_modules = true
$webhook_r10k_generate_types = true
$webhook_service_ensure = 'running'
$webhook_service_enabled = true
}
50 changes: 25 additions & 25 deletions manifests/webhook.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,44 @@
#
class r10k::webhook (
Enum['package', 'repo', 'none'] $install_method = 'package',
Boolean $ensure = $r10k::params::webhook_ensure,
String $version = $r10k::params::webhook_version,
Boolean $ensure = false,
String $version = '2.1.0',
Variant[
Enum['running', 'stopped'],
Boolean
] $service_ensure = $r10k::params::webhook_service_ensure,
Boolean $service_enabled = $r10k::params::webhook_service_enabled,
] $service_ensure = 'running',
Boolean $service_enabled = true,
String $config_ensure = 'file',
String $config_path = '/etc/voxpupuli/webhook.yml',
R10k::Webhook::Config::ChatOps $chatops = {
enabled => $r10k::params::webhook_chatops_enabled,
service => $r10k::params::webhook_chatops_service,
channel => $r10k::params::webhook_chatops_channel,
user => $r10k::params::webhook_chatops_user,
auth_token => $r10k::params::webhook_chatops_token,
server_uri => $r10k::params::webhook_chatops_uri,
enabled => false,
service => '',
channel => '',
user => '',
auth_token => '',
server_uri => '',
},
R10k::Webhook::Config::Server::Tls $tls = {
enabled => $r10k::params::webhook_tls_enabled,
certificate => $r10k::params::webhook_tls_cert_path,
key => $r10k::params::webhook_tls_key_path,
enabled => false,
certificate => undef,
key => undef,
},
R10k::Webhook::Config::Server $server = {
protected => $r10k::params::webhook_protected,
user => $r10k::params::webhook_user,
password => $r10k::params::webhook_password,
port => $r10k::params::webhook_port,
protected => true,
user => 'puppet',
password => 'puppet',
port => 4000,
tls => $tls,
},
R10k::Webhook::Config::R10k $r10k = {
command_path => $r10k::params::webhook_r10k_command_path,
config_path => $r10k::params::webhook_r10k_config_path,
default_branch => $r10k::params::webhook_r10k_default_branch,
prefix => $r10k::params::webhook_r10k_branch_prefix,
allow_uppercase => $r10k::params::webhook_r10k_allow_uppercase,
verbose => $r10k::params::webhook_r10k_verbose,
deploy_modules => $r10k::params::webhook_r10k_deploy_modules,
generate_types => $r10k::params::webhook_r10k_generate_types,
command_path => '/opt/puppetlabs/puppet/bin/r10k',
config_path => '/etc/puppetlabs/r10k/r10k.yaml',
default_branch => 'production',
prefix => '',
allow_uppercase => false,
verbose => true,
deploy_modules => true,
generate_types => true,
},
R10k::Webhook::Config $config = {
server => $server,
Expand Down