Skip to content

Commit 46261ed

Browse files
authored
Merge pull request #680 from elfranne/master
Add support for webhook queue options
2 parents abc8b5d + 7481449 commit 46261ed

File tree

6 files changed

+62
-0
lines changed

6 files changed

+62
-0
lines changed

REFERENCE.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
* [`R10k::Webhook::Config::Chatops`](#R10k--Webhook--Config--Chatops): webhook config chatops type
3333
* [`R10k::Webhook::Config::R10k`](#R10k--Webhook--Config--R10k): webhook config r10k type
3434
* [`R10k::Webhook::Config::Server`](#R10k--Webhook--Config--Server): webhook config server type
35+
* [`R10k::Webhook::Config::Server::Queue`](#R10k--Webhook--Config--Server--Queue): webhook config server queue type
3536
* [`R10k::Webhook::Config::Server::Tls`](#R10k--Webhook--Config--Server--Tls): webhook config server tls type
3637

3738
### Tasks
@@ -533,6 +534,7 @@ The following parameters are available in the `r10k::webhook` class:
533534
* [`config_path`](#-r10k--webhook--config_path)
534535
* [`chatops`](#-r10k--webhook--chatops)
535536
* [`tls`](#-r10k--webhook--tls)
537+
* [`queue`](#-r10k--webhook--queue)
536538
* [`server`](#-r10k--webhook--server)
537539
* [`r10k`](#-r10k--webhook--r10k)
538540
* [`config`](#-r10k--webhook--config)
@@ -635,6 +637,22 @@ Default value:
635637
}
636638
```
637639

640+
##### <a name="-r10k--webhook--queue"></a>`queue`
641+
642+
Data type: `R10k::Webhook::Config::Server::Queue`
643+
644+
645+
646+
Default value:
647+
648+
```puppet
649+
{
650+
enabled => false,
651+
max_concurrent_jobs => undef,
652+
max_history_items => undef,
653+
}
654+
```
655+
638656
##### <a name="-r10k--webhook--server"></a>`server`
639657

640658
Data type: `R10k::Webhook::Config::Server`
@@ -650,6 +668,7 @@ Default value:
650668
password => 'puppet',
651669
port => 4000,
652670
tls => $tls,
671+
queue => $queue,
653672
}
654673
```
655674

@@ -767,6 +786,21 @@ Struct[{
767786
password => Optional[String[1]],
768787
port => Optional[Stdlib::Port],
769788
tls => Optional[R10k::Webhook::Config::Server::Tls],
789+
queue => Optional[R10k::Webhook::Config::Server::Queue],
790+
}]
791+
```
792+
793+
### <a name="R10k--Webhook--Config--Server--Queue"></a>`R10k::Webhook::Config::Server::Queue`
794+
795+
webhook config server queue type
796+
797+
Alias of
798+
799+
```puppet
800+
Struct[{
801+
enabled => Boolean,
802+
max_concurrent_jobs => Optional[Integer],
803+
max_history_items => Optional[Integer],
770804
}]
771805
```
772806

manifests/webhook.pp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# @param config_path
1111
# @param chatops
1212
# @param tls
13+
# @param queue
1314
# @param server
1415
# @param r10k
1516
# @param config
@@ -38,12 +39,18 @@
3839
certificate => undef,
3940
key => undef,
4041
},
42+
R10k::Webhook::Config::Server::Queue $queue = {
43+
enabled => false,
44+
max_concurrent_jobs => undef,
45+
max_history_items => undef,
46+
},
4147
R10k::Webhook::Config::Server $server = {
4248
protected => true,
4349
user => 'puppet',
4450
password => 'puppet',
4551
port => 4000,
4652
tls => $tls,
53+
queue => $queue,
4754
},
4855
R10k::Webhook::Config::R10k $r10k = {
4956
command_path => '/opt/puppetlabs/puppet/bin/r10k',

spec/classes/webhook_spec.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@
4949
certificate: '/path/to/cert',
5050
key: '/path/to/key',
5151
},
52+
queue: {
53+
enabled: true,
54+
max_concurrent_jobs: 10,
55+
max_history_items: 20,
56+
}
5257
},
5358
r10k: {
5459
command_path: '/opt/puppetlabs/puppet/bin/r10k',
@@ -72,6 +77,10 @@
7277
enabled: true
7378
certificate: "/path/to/cert"
7479
key: "/path/to/key"
80+
queue:
81+
enabled: true
82+
max_concurrent_jobs: 10
83+
max_history_items: 20
7584
chatops:
7685
enabled: true
7786
service: slack

spec/type_aliases/webhook/config_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
certificate: '/some/path/to/cert.pem',
1717
key: '/some/path/to/key.pem',
1818
},
19+
queue: {
20+
enabled: true,
21+
max_concurrent_jobs: 10,
22+
max_history_items: 20,
23+
},
1924
},
2025
chatops: {
2126
enabled: true,

types/webhook/config/server.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
password => Optional[String[1]],
66
port => Optional[Stdlib::Port],
77
tls => Optional[R10k::Webhook::Config::Server::Tls],
8+
queue => Optional[R10k::Webhook::Config::Server::Queue],
89
}]

types/webhook/config/server/queue.pp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# @summary webhook config server queue type
2+
type R10k::Webhook::Config::Server::Queue = Struct[{
3+
enabled => Boolean,
4+
max_concurrent_jobs => Optional[Integer],
5+
max_history_items => Optional[Integer],
6+
}]

0 commit comments

Comments
 (0)