commit 31b1762780ddf211709dab2e3abbeba499ab9f30
Author: Steve Traylen <steve.traylen@cern.ch>
Date:   Mon Dec 7 16:38:46 2020 +0100

    Use single line for each parameter definition

diff --git a/manifests/bridges.pp b/manifests/bridges.pp
index 0f23510..cb7f7cb 100644
--- a/manifests/bridges.pp
+++ b/manifests/bridges.pp
@@ -1,9 +1,7 @@
 # allow forwarding traffic on bridges
 class nftables::bridges (
-  Enum['present','absent']
-  $ensure = 'present',
-  Regexp
-  $bridgenames = /^br.+/
+  Enum['present','absent'] $ensure = 'present',
+  Regexp $bridgenames = /^br.+/
 ) {
   if $ensure == 'present' {
     $interfaces = keys($facts['networking']['interfaces'])
diff --git a/manifests/chain.pp b/manifests/chain.pp
index 25f65d6..9f63348 100644
--- a/manifests/chain.pp
+++ b/manifests/chain.pp
@@ -1,15 +1,10 @@
 # manage a chain
 define nftables::chain (
-  Pattern[/^(ip|ip6|inet)-[a-zA-Z0-9_]+$/]
-  $table = 'inet-filter',
-  Pattern[/^[a-zA-Z0-9_]+$/]
-  $chain = $title,
-  Optional[Pattern[/^\d\d-[a-zA-Z0-9_]+$/]]
-  $inject = undef,
-  Optional[String]
-  $inject_iif = undef,
-  Optional[String]
-  $inject_oif = undef,
+  Pattern[/^(ip|ip6|inet)-[a-zA-Z0-9_]+$/] $table = 'inet-filter',
+  Pattern[/^[a-zA-Z0-9_]+$/] $chain = $title,
+  Optional[Pattern[/^\d\d-[a-zA-Z0-9_]+$/]] $inject = undef,
+  Optional[String] $inject_iif = undef,
+  Optional[String] $inject_oif = undef,
 ) {
   $concat_name = "nftables-${table}-chain-${chain}"
 
diff --git a/manifests/config.pp b/manifests/config.pp
index 99e8ae9..f302a47 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -1,9 +1,7 @@
 # manage a config snippet
 define nftables::config (
-  Optional[String]
-  $content = undef,
-  Optional[Variant[String,Array[String,1]]]
-  $source = undef,
+  Optional[String] $content = undef,
+  Optional[Variant[String,Array[String,1]]] $source = undef,
 ) {
   $concat_name = "nftables-${name}"
 
diff --git a/manifests/init.pp b/manifests/init.pp
index 5f10024..0177069 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -80,29 +80,24 @@
 #   If left unset all tables will be flushed via a `flush ruleset`
 #
 class nftables (
-  Boolean $in_ssh                = true,
-  Boolean $in_icmp               = true,
-  Boolean $out_ntp               = true,
-  Boolean $out_dns               = true,
-  Boolean $out_http              = true,
-  Boolean $out_https             = true,
-  Boolean $out_icmp              = true,
-  Boolean $out_all               = false,
-  Boolean $in_out_conntrack      = true,
-  Boolean $fwd_conntrack         = false,
-  Boolean $nat                   = true,
-  Hash $rules                    = {},
-  Hash $sets                     = {},
-  String $log_prefix             = '[nftables] %<chain>s %<comment>s',
-  Variant[Boolean[false], String]
-  $log_limit                   = '3/minute burst 5 packets',
-  Variant[Boolean[false], Pattern[
-  /icmp(v6|x)? type .+|tcp reset/]]
-  $reject_with                 = 'icmpx type port-unreachable',
-  Variant[Boolean[false], Enum['mask']]
-  $firewalld_enable            = 'mask',
-  Optional[Array[Pattern[/^(ip|ip6|inet)-[-a-zA-Z0-9_]+$/],1]]
-  $noflush_tables = undef,
+  Boolean $in_ssh = true,
+  Boolean $in_icmp = true,
+  Boolean $out_ntp = true,
+  Boolean $out_dns = true,
+  Boolean $out_http = true,
+  Boolean $out_https = true,
+  Boolean $out_icmp = true,
+  Boolean $out_all = false,
+  Boolean $in_out_conntrack = true,
+  Boolean $fwd_conntrack = false,
+  Boolean $nat = true,
+  Hash $rules = {},
+  Hash $sets = {},
+  String $log_prefix = '[nftables] %<chain>s %<comment>s',
+  Variant[Boolean[false], String] $log_limit = '3/minute burst 5 packets',
+  Variant[Boolean[false], Pattern[/icmp(v6|x)? type .+|tcp reset/]] $reject_with = 'icmpx type port-unreachable',
+  Variant[Boolean[false], Enum['mask']] $firewalld_enable = 'mask',
+  Optional[Array[Pattern[/^(ip|ip6|inet)-[-a-zA-Z0-9_]+$/],1]] $noflush_tables = undef,
 ) {
   package { 'nftables':
     ensure => installed,
diff --git a/manifests/rule.pp b/manifests/rule.pp
index 9c575ec..94c56f3 100644
--- a/manifests/rule.pp
+++ b/manifests/rule.pp
@@ -2,18 +2,12 @@
 # Name should be:
 #   CHAIN_NAME-rulename
 define nftables::rule (
-  Enum['present','absent']
-  $ensure = 'present',
-  Pattern[/^[a-zA-Z0-9_]+-[a-zA-Z0-9_]+(-\d+)?$/]
-  $rulename = $title,
-  Pattern[/^\d\d$/]
-  $order = '50',
-  Optional[String]
-  $table = 'inet-filter',
-  Optional[String]
-  $content = undef,
-  Optional[Variant[String,Array[String,1]]]
-  $source = undef,
+  Enum['present','absent'] $ensure = 'present',
+  Pattern[/^[a-zA-Z0-9_]+-[a-zA-Z0-9_]+(-\d+)?$/] $rulename = $title,
+  Pattern[/^\d\d$/] $order = '50',
+  Optional[String] $table = 'inet-filter',
+  Optional[String] $content = undef,
+  Optional[Variant[String,Array[String,1]]] $source = undef,
 ) {
   if $ensure == 'present' {
     $data = split($rulename, '-')
diff --git a/manifests/rules/dnat4.pp b/manifests/rules/dnat4.pp
index 6d63c21..601ac30 100644
--- a/manifests/rules/dnat4.pp
+++ b/manifests/rules/dnat4.pp
@@ -1,23 +1,14 @@
 # manage a ipv4 dnat rule
 define nftables::rules::dnat4 (
-  Pattern[/^[12]?\d{1,2}\.[12]?\d{1,2}\.[12]?\d{1,2}\.[12]?\d{1,2}$/]
-  $daddr,
-  Variant[String,Integer[1,65535]]
-  $port,
-  Pattern[/^[a-zA-Z0-9_]+$/]
-  $rulename = $title,
-  Pattern[/^\d\d$/]
-  $order = '50',
-  String[1]
-  $chain = 'default_fwd',
-  Optional[String[1]]
-  $iif = undef,
-  Enum['tcp','udp']
-  $proto = 'tcp',
-  Optional[Variant[String,Integer[1,65535]]]
-  $dport = '',
-  Enum['present','absent']
-  $ensure = 'present',
+  Pattern[/^[12]?\d{1,2}\.[12]?\d{1,2}\.[12]?\d{1,2}\.[12]?\d{1,2}$/] $daddr,
+  Variant[String,Integer[1,65535]] $port,
+  Pattern[/^[a-zA-Z0-9_]+$/] $rulename = $title,
+  Pattern[/^\d\d$/] $order = '50',
+  String[1] $chain = 'default_fwd',
+  Optional[String[1]] $iif = undef,
+  Enum['tcp','udp'] $proto = 'tcp',
+  Optional[Variant[String,Integer[1,65535]]] $dport = '',
+  Enum['present','absent'] $ensure = 'present',
 ) {
   $iifname = $iif ? {
     undef   => '',
diff --git a/manifests/rules/dns.pp b/manifests/rules/dns.pp
index 2bb23fa..6cfb5ad 100644
--- a/manifests/rules/dns.pp
+++ b/manifests/rules/dns.pp
@@ -1,7 +1,6 @@
 # manage in dns
 class nftables::rules::dns (
-  Array[Integer,1]
-  $ports = [53],
+  Array[Integer,1] $ports = [53],
 ) {
   nftables::rule {
     'default_in-dns_tcp':
diff --git a/manifests/rules/icinga2.pp b/manifests/rules/icinga2.pp
index 32ec68c..be6875e 100644
--- a/manifests/rules/icinga2.pp
+++ b/manifests/rules/icinga2.pp
@@ -1,7 +1,6 @@
 # manage in icinga2
 class nftables::rules::icinga2 (
-  Array[Integer,1]
-  $ports = [5665],
+  Array[Integer,1] $ports = [5665],
 ) {
   nftables::rule {
     'default_in-icinga2':
diff --git a/manifests/rules/masquerade.pp b/manifests/rules/masquerade.pp
index d2d7943..a2845f1 100644
--- a/manifests/rules/masquerade.pp
+++ b/manifests/rules/masquerade.pp
@@ -1,23 +1,14 @@
 # masquerade all outgoing traffic
 define nftables::rules::masquerade (
-  Pattern[/^[a-zA-Z0-9_]+$/]
-  $rulename = $title,
-  Pattern[/^\d\d$/]
-  $order = '70',
-  String[1]
-  $chain = 'POSTROUTING',
-  Optional[String[1]]
-  $oif = undef,
-  Optional[String[1]]
-  $saddr = undef,
-  Optional[String[1]]
-  $daddr = undef,
-  Optional[Enum['tcp','udp']]
-  $proto = undef,
-  Optional[Variant[String,Integer[1,65535]]]
-  $dport = undef,
-  Enum['present','absent']
-  $ensure = 'present',
+  Pattern[/^[a-zA-Z0-9_]+$/] $rulename = $title,
+  Pattern[/^\d\d$/] $order = '70',
+  String[1] $chain = 'POSTROUTING',
+  Optional[String[1]] $oif = undef,
+  Optional[String[1]] $saddr = undef,
+  Optional[String[1]] $daddr = undef,
+  Optional[Enum['tcp','udp']] $proto = undef,
+  Optional[Variant[String,Integer[1,65535]]] $dport = undef,
+  Enum['present','absent'] $ensure = 'present',
 ) {
   $oifname = $oif ? {
     undef   => '',
diff --git a/manifests/rules/node_exporter.pp b/manifests/rules/node_exporter.pp
index 42fb106..6086183 100644
--- a/manifests/rules/node_exporter.pp
+++ b/manifests/rules/node_exporter.pp
@@ -1,9 +1,7 @@
 # manage in node exporter
 class nftables::rules::node_exporter (
-  Optional[Variant[String,Array[String,1]]]
-  $prometheus_server = undef,
-  Integer
-  $port = 9100,
+  Optional[Variant[String,Array[String,1]]] $prometheus_server = undef,
+  Integer $port = 9100,
 ) {
   if $prometheus_server {
     any2array($prometheus_server).each |$index,$prom| {
diff --git a/manifests/rules/out/dns.pp b/manifests/rules/out/dns.pp
index 513cfa4..997f29a 100644
--- a/manifests/rules/out/dns.pp
+++ b/manifests/rules/out/dns.pp
@@ -1,7 +1,6 @@
 # manage out dns
 class nftables::rules::out::dns (
-  Optional[Variant[String,Array[String,1]]]
-  $dns_server = undef,
+  Optional[Variant[String,Array[String,1]]] $dns_server = undef,
 ) {
   if $dns_server {
     any2array($dns_server).each |$index,$dns| {
diff --git a/manifests/rules/out/icmp.pp b/manifests/rules/out/icmp.pp
index d6171ac..4d13280 100644
--- a/manifests/rules/out/icmp.pp
+++ b/manifests/rules/out/icmp.pp
@@ -1,7 +1,7 @@
 class nftables::rules::out::icmp (
   Optional[Array[String]] $v4_types = undef,
   Optional[Array[String]] $v6_types = undef,
-  String $order                     = '10',
+  String $order = '10',
 ) {
   if $v4_types {
     $v4_types.each | String $icmp_type | {
diff --git a/manifests/rules/out/puppet.pp b/manifests/rules/out/puppet.pp
index f078301..1f76191 100644
--- a/manifests/rules/out/puppet.pp
+++ b/manifests/rules/out/puppet.pp
@@ -1,9 +1,7 @@
 # manage outgoing puppet
 class nftables::rules::out::puppet (
-  Variant[String,Array[String,1]]
-  $puppetmaster,
-  Integer
-  $puppetserver_port = 8140,
+  Variant[String,Array[String,1]] $puppetmaster,
+  Integer $puppetserver_port = 8140,
 ) {
   any2array($puppetmaster).each |$index,$pm| {
     nftables::rule {
diff --git a/manifests/rules/out/wireguard.pp b/manifests/rules/out/wireguard.pp
index 075cfc5..b8126c4 100644
--- a/manifests/rules/out/wireguard.pp
+++ b/manifests/rules/out/wireguard.pp
@@ -1,7 +1,6 @@
 # manage out wireguard
 class nftables::rules::out::wireguard (
-  Array[Integer,1]
-  $ports = [51820],
+  Array[Integer,1] $ports = [51820],
 ) {
   nftables::rule {
     'default_out-wireguard':
diff --git a/manifests/rules/puppet.pp b/manifests/rules/puppet.pp
index 53a2bb1..d534770 100644
--- a/manifests/rules/puppet.pp
+++ b/manifests/rules/puppet.pp
@@ -1,7 +1,6 @@
 # manage in puppet
 class nftables::rules::puppet (
-  Array[Integer,1]
-  $ports = [8140],
+  Array[Integer,1] $ports = [8140],
 ) {
   nftables::rule {
     'default_in-puppet':
diff --git a/manifests/rules/snat4.pp b/manifests/rules/snat4.pp
index 565110e..8a64393 100644
--- a/manifests/rules/snat4.pp
+++ b/manifests/rules/snat4.pp
@@ -1,23 +1,14 @@
 # manage a ipv4 snat rule
 define nftables::rules::snat4 (
-  String[1]
-  $snat,
-  Pattern[/^[a-zA-Z0-9_]+$/]
-  $rulename = $title,
-  Pattern[/^\d\d$/]
-  $order = '70',
-  String[1]
-  $chain = 'POSTROUTING',
-  Optional[String[1]]
-  $oif = undef,
-  Optional[String[1]]
-  $saddr = undef,
-  Optional[Enum['tcp','udp']]
-  $proto = undef,
-  Optional[Variant[String,Integer[1,65535]]]
-  $dport = undef,
-  Enum['present','absent']
-  $ensure = 'present',
+  String[1] $snat,
+  Pattern[/^[a-zA-Z0-9_]+$/] $rulename = $title,
+  Pattern[/^\d\d$/] $order = '70',
+  String[1] $chain = 'POSTROUTING',
+  Optional[String[1]] $oif = undef,
+  Optional[String[1]] $saddr = undef,
+  Optional[Enum['tcp','udp']] $proto = undef,
+  Optional[Variant[String,Integer[1,65535]]] $dport = undef,
+  Enum['present','absent'] $ensure = 'present',
 ) {
   $oifname = $oif ? {
     undef   => '',
diff --git a/manifests/rules/ssh.pp b/manifests/rules/ssh.pp
index 878817c..2fcb8af 100644
--- a/manifests/rules/ssh.pp
+++ b/manifests/rules/ssh.pp
@@ -1,7 +1,6 @@
 # manage in ssh
 class nftables::rules::ssh (
-  Array[Integer,1]
-  $ports = [22],
+  Array[Integer,1] $ports = [22],
 ) {
   nftables::rule {
     'default_in-ssh':
diff --git a/manifests/rules/tor.pp b/manifests/rules/tor.pp
index c70c581..6167204 100644
--- a/manifests/rules/tor.pp
+++ b/manifests/rules/tor.pp
@@ -1,7 +1,6 @@
 # manage in tor
 class nftables::rules::tor (
-  Array[Integer,1]
-  $ports = [9001],
+  Array[Integer,1] $ports = [9001],
 ) {
   nftables::rule {
     'default_in-tor':
diff --git a/manifests/rules/wireguard.pp b/manifests/rules/wireguard.pp
index 780a8ce..3761a0b 100644
--- a/manifests/rules/wireguard.pp
+++ b/manifests/rules/wireguard.pp
@@ -1,7 +1,6 @@
 # manage in wireguard
 class nftables::rules::wireguard (
-  Array[Integer,1]
-  $ports = [51820],
+  Array[Integer,1] $ports = [51820],
 ) {
   nftables::rule {
     'default_in-wireguard':
diff --git a/manifests/set.pp b/manifests/set.pp
index 2bdbcc0..df8d259 100644
--- a/manifests/set.pp
+++ b/manifests/set.pp
@@ -1,33 +1,19 @@
 # manage a named set
 define nftables::set (
-  Enum['present','absent']
-  $ensure = 'present',
-  Pattern[/^[-a-zA-Z0-9_]+$/]
-  $setname = $title,
-  Pattern[/^\d\d$/]
-  $order = '10',
-  Optional[Enum['ipv4_addr', 'ipv6_addr', 'ether_addr', 'inet_proto', 'inet_service', 'mark']]
-  $type = undef,
-  String
-  $table = 'inet-filter',
-  Array[Enum['constant', 'dynamic', 'interval', 'timeout'], 0, 4]
-  $flags = [],
-  Optional[Integer]
-  $timeout = undef,
-  Optional[Integer]
-  $gc_interval = undef,
-  Optional[Array[String]]
-  $elements = undef,
-  Optional[Integer]
-  $size = undef,
-  Optional[Enum['performance', 'memory']]
-  $policy = undef,
-  Boolean
-  $auto_merge = false,
-  Optional[String]
-  $content = undef,
-  Optional[Variant[String,Array[String,1]]]
-  $source = undef,
+  Enum['present','absent'] $ensure = 'present',
+  Pattern[/^[-a-zA-Z0-9_]+$/] $setname = $title,
+  Pattern[/^\d\d$/] $order = '10',
+  Optional[Enum['ipv4_addr', 'ipv6_addr', 'ether_addr', 'inet_proto', 'inet_service', 'mark']] $type = undef,
+  String $table = 'inet-filter',
+  Array[Enum['constant', 'dynamic', 'interval', 'timeout'], 0, 4] $flags = [],
+  Optional[Integer] $timeout = undef,
+  Optional[Integer] $gc_interval = undef,
+  Optional[Array[String]] $elements = undef,
+  Optional[Integer] $size = undef,
+  Optional[Enum['performance', 'memory']] $policy = undef,
+  Boolean $auto_merge = false,
+  Optional[String] $content = undef,
+  Optional[Variant[String,Array[String,1]]] $source = undef,
 ) {
   if $size and $elements {
     if length($elements) > $size {
