From 1cac4e2edf5b944c20588e079261ecfe4e60557f Mon Sep 17 00:00:00 2001 From: Fabien COMBERNOUS <fabien.combernous@adullact.org> Date: Thu, 3 Nov 2022 10:09:08 +0100 Subject: [PATCH] fix lint errors --- manifests/ca/root.pp | 8 ++++---- manifests/goose.pp | 10 +++++----- manifests/init.pp | 15 ++++++--------- types/authkey.pp | 4 ++-- types/ca/key.pp | 4 ++-- types/serveconfig.pp | 10 +++++----- types/signing/profile.pp | 16 ++++++++-------- 7 files changed, 32 insertions(+), 35 deletions(-) diff --git a/manifests/ca/root.pp b/manifests/ca/root.pp index e235d46..cb424f4 100644 --- a/manifests/ca/root.pp +++ b/manifests/ca/root.pp @@ -5,21 +5,21 @@ # @example # include cfssl::ca::root class cfssl::ca::root ( - Hash $subject = { 'C' => 'FR', 'L' => 'MONTPELLIER', 'O' => 'EXEMPLE ORG', 'OU' => 'IT Dept'}, + Hash $subject = { 'C' => 'FR', 'L' => 'MONTPELLIER', 'O' => 'EXEMPLE ORG', 'OU' => 'IT Dept' }, String[1] $cn = 'EXEMPLE ROOT CA GEN1', String[1] $expiry = '43800h', Cfssl::Ca::Key $key = { algo => 'rsa', size => 2048 }, -){ +) { $_rootca_filename = 'ROOT_ca' $_rootca_csr = { cn => $cn, names => [$subject], - ca => {expiry => $expiry}, + ca => { expiry => $expiry }, key => $key, } $_rootca_csr_json = to_json($_rootca_csr) - exec {"initca ${cn}": + exec { "initca ${cn}": path => "/usr/bin:${cfssl::binpath}", command => "echo '${_rootca_csr_json}' | cfssl gencert -initca - | cfssljson -bare ${cfssl::confdir}/ca/${_rootca_filename}", creates => "${cfssl::confdir}/ca/${_rootca_filename}-key.pem", diff --git a/manifests/goose.pp b/manifests/goose.pp index d521937..683f94f 100644 --- a/manifests/goose.pp +++ b/manifests/goose.pp @@ -14,10 +14,10 @@ class cfssl::goose { target => '/usr/lib/go-1.16/bin/go', } -> exec { 'install goose': - command => '/usr/local/bin/go get bitbucket.org/liamstask/goose/cmd/goose', - creates => "/home/${cfssl::sysuser}/go/bin/goose", - user => $cfssl::sysuser, - environment => ["HOME=/home/${cfssl::sysuser}/"], - require => User[$cfssl::sysuser], + command => '/usr/local/bin/go get bitbucket.org/liamstask/goose/cmd/goose', + creates => "/home/${cfssl::sysuser}/go/bin/goose", + user => $cfssl::sysuser, + environment => ["HOME=/home/${cfssl::sysuser}/"], + require => User[$cfssl::sysuser], } } diff --git a/manifests/init.pp b/manifests/init.pp index 003c27b..537babf 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -21,11 +21,9 @@ class cfssl ( String[1] $dbpassword = 'changeme', Stdlib::Absolutepath $confdir = '/etc/cfssl', Stdlib::Absolutepath $binpath = '/usr/local/bin', - Cfssl::Serveconfig $serve_config = { signing => { 'default' => { expiry => '1h', usages => ['client auth'] }}}, + Cfssl::Serveconfig $serve_config = { signing => { 'default' => { expiry => '1h', usages => ['client auth'] } } }, String[1] $serve_ca = 'ROOT_ca', -){ - - # modify serve_config needs restart cfssl serve +) { include cfssl::goose include postgresql::server @@ -64,9 +62,9 @@ class cfssl ( $_archiveurn = "v${version}/${_bin}_${version}_linux_amd64" archive::download { "${binpath}/${_bin}" : - ensure => present, - url => "${downloadurl}/${_archiveurn}", - subscribe => Archive::Download["${binpath}/cfssl"], + ensure => present, + url => "${downloadurl}/${_archiveurn}", + subscribe => Archive::Download["${binpath}/cfssl"], } ~> file { "${binpath}/${_bin}" : ensure => file, @@ -77,7 +75,7 @@ class cfssl ( } } - file { [$confdir, "${confdir}/ca", $logdir] : + file { [$confdir, "${confdir}/ca", $logdir]: ensure => directory, mode => '0700', owner => $sysuser, @@ -105,7 +103,6 @@ class cfssl ( content => to_json_pretty($serve_config), } - vcsrepo { $_goose_cfssldbmigrate_path: ensure => present, provider => git, diff --git a/types/authkey.pp b/types/authkey.pp index bf0bfa1..c1059d8 100644 --- a/types/authkey.pp +++ b/types/authkey.pp @@ -1,4 +1,4 @@ type Cfssl::Authkey = Struct[{ - type => Enum['standard'], - key => String[1], + type => Enum['standard'], + key => String[1], }] diff --git a/types/ca/key.pp b/types/ca/key.pp index 18f5ca8..de2ee10 100644 --- a/types/ca/key.pp +++ b/types/ca/key.pp @@ -1,4 +1,4 @@ type Cfssl::Ca::Key = Struct[{ - algo => Enum['rsa','ecdsa'], - size => Integer, + algo => Enum['rsa','ecdsa'], + size => Integer, }] diff --git a/types/serveconfig.pp b/types/serveconfig.pp index e71133d..66761cd 100644 --- a/types/serveconfig.pp +++ b/types/serveconfig.pp @@ -1,7 +1,7 @@ type Cfssl::Serveconfig = Struct[{ - auth_keys => Optional[Hash[String,Cfssl::Authkey]], - signing => Struct[{ - 'default' => Cfssl::Signing::Profile, - profiles => Optional[Hash[String,Cfssl::Signing::Profile]], - }], + auth_keys => Optional[Hash[String,Cfssl::Authkey]], + signing => Struct[{ + 'default' => Cfssl::Signing::Profile, + profiles => Optional[Hash[String,Cfssl::Signing::Profile]], + }], }] diff --git a/types/signing/profile.pp b/types/signing/profile.pp index 3f40697..f79196e 100644 --- a/types/signing/profile.pp +++ b/types/signing/profile.pp @@ -1,10 +1,10 @@ type Cfssl::Signing::Profile = Struct[{ - expiry => String[1], - usages => Array[Cfssl::Usage], - crl_url => Optional[Stdlib::HTTPUrl], - ocsp_url => Optional[Stdlib::HTTPUrl], - not_before => Optional[String[1]], - not_after => Optional[String[1]], - name_whitelist => Optional[String[1]], - auth_key => Optional[String[1]], + expiry => String[1], + usages => Array[Cfssl::Usage], + crl_url => Optional[Stdlib::HTTPUrl], + ocsp_url => Optional[Stdlib::HTTPUrl], + not_before => Optional[String[1]], + not_after => Optional[String[1]], + name_whitelist => Optional[String[1]], + auth_key => Optional[String[1]], }] -- GitLab