(GH-cat-9) syntax:hiera:yaml fixes
authordavid22swan <david.swan@puppet.com>
Wed, 20 Apr 2022 13:07:49 +0000 (14:07 +0100)
committerdavid22swan <david.swan@puppet.com>
Wed, 20 Apr 2022 13:07:49 +0000 (14:07 +0100)
16 files changed:
examples/builddep.pp
examples/debian_testing.pp
examples/debian_unstable.pp
examples/disable_keys.pp
examples/ppa.pp
manifests/backports.pp
manifests/conf.pp
manifests/init.pp
manifests/key.pp
manifests/mark.pp
manifests/params.pp
manifests/pin.pp
manifests/ppa.pp
manifests/setting.pp
manifests/source.pp
manifests/update.pp

index deaaef8c8ff6d4a6a7b1ed2fe02ac08edafa3558..8c23a9427612f82531e1eb66f9fac25e6c8efe01 100644 (file)
@@ -1,3 +1,3 @@
-package{ 'glusterfs-server':
+package { 'glusterfs-server':
   install_options => 'build-dep',
 }
index 3ed98f21f12e9d225dca4e06d008707e45f45a80..bea2f0857eeb2d21a832a6cebcaee6af3cb3d0ca 100644 (file)
@@ -1,9 +1,9 @@
 package { 'debian-keyring':
-  ensure => present
+  ensure => present,
 }
 
 package { 'debian-archive-keyring':
-  ensure => present
+  ensure => present,
 }
 
 apt::source { 'debian_testing':
index b1492cd53862303a39c05ef3d59b67d25c579d31..344f90cf8c7ebd46fe8485c041a9ee1d4d493cc7 100644 (file)
@@ -1,9 +1,9 @@
 package { 'debian-keyring':
-  ensure => present
+  ensure => present,
 }
 
 package { 'debian-archive-keyring':
-  ensure => present
+  ensure => present,
 }
 
 apt::source { 'debian_unstable':
index 50d0ea8022aabe54a553529b1ff3ed684f169316..a39b93226d5b4d19f978bc32b13e8d5b654f09fe 100644 (file)
@@ -1,5 +1,5 @@
 #Note: This is generally a bad idea. You should not disable verifying repository signatures.
 apt::conf { 'unauth':
   priority => 99,
-  content  => 'APT::Get::AllowUnauthenticated 1;'
+  content  => 'APT::Get::AllowUnauthenticated 1;',
 }
index e728f6f10f50e6ea1a9881c14df7096645062f15..1dea2b4f207531c9d44463de98fe93a33bc56276 100644 (file)
@@ -1,4 +1,4 @@
 class { 'apt': }
 
 # Example declaration of an Apt PPA
-apt::ppa{ 'ppa:openstack-ppa/bleeding-edge': }
+apt::ppa { 'ppa:openstack-ppa/bleeding-edge': }
index 0dcecbe09a13a42ce4f475efff6ffaf4c1013b3e..1a9ea1bcaefb4c629209cc25543b9e63308d6757 100644 (file)
@@ -53,8 +53,8 @@ class apt::backports (
   Optional[String] $release                     = undef,
   Optional[String] $repos                       = undef,
   Optional[Variant[String, Hash]] $key          = undef,
-  Optional[Variant[Integer, String, Hash]] $pin = 200,
-  Optional[Variant[Hash]] $include              = {},
+  Variant[Integer, String, Hash] $pin           = 200,
+  Variant[Hash] $include                        = {},
 ) {
   include apt
 
index c27f0c1c0dcd683699caec9572739157468a57d7..0aec66dd63f69f5bb68195e4f9f6120c0c6332ae 100644 (file)
@@ -19,7 +19,6 @@ define apt::conf (
   Variant[String, Integer] $priority = 50,
   Optional[Boolean] $notify_update   = undef,
 ) {
-
   unless $ensure == 'absent' {
     unless $content {
       fail('Need to pass in content parameter')
index 7e4b4c981cc97d9f8db4631af8f005c309cc93bd..4aa4a68ccd4c70dd7d8a1267b2309caa8d09cdce 100644 (file)
@@ -143,7 +143,7 @@ class apt (
   Hash $settings                = $apt::params::settings,
   Boolean $manage_auth_conf     = $apt::params::manage_auth_conf,
   Array[Apt::Auth_conf_entry]
-    $auth_conf_entries          = $apt::params::auth_conf_entries,
+  $auth_conf_entries            = $apt::params::auth_conf_entries,
   String $auth_conf_owner       = $apt::params::auth_conf_owner,
   String $root                  = $apt::params::root,
   String $sources_list          = $apt::params::sources_list,
@@ -163,7 +163,6 @@ class apt (
   }
 
 ) inherits apt::params {
-
   if $facts['os']['family'] != 'Debian' {
     fail('This module only works on Debian or derivatives like Ubuntu')
   }
@@ -226,10 +225,10 @@ class apt (
     $_perhost = {}
   }
 
-  $_proxy = merge($apt::proxy_defaults, $proxy, { 'perhost' => $_perhost } )
+  $_proxy = merge($apt::proxy_defaults, $proxy, { 'perhost' => $_perhost })
 
   $confheadertmp = epp('apt/_conf_header.epp')
-  $proxytmp = epp('apt/proxy.epp', {'proxies' => $_proxy})
+  $proxytmp = epp('apt/proxy.epp', { 'proxies' => $_proxy })
   $updatestamptmp = epp('apt/15update-stamp.epp')
 
   if $_proxy['ensure'] == 'absent' or $_proxy['host'] {
@@ -249,9 +248,7 @@ class apt (
       true    => nil,
       default => undef,
     }
-  }
-  else
-    {
+  } else {
     $sources_list_ensure = $_purge['sources.list'] ? {
       true    => file,
       default => file,
index 48487632c18ccd37ce7d7eb46afda15a7083e578..e432f3c22724511d91f94f06dca0c99851b508ad 100644 (file)
@@ -44,10 +44,9 @@ define apt::key (
   Boolean $weak_ssl                                                                                                     = false,
   Optional[String] $options                                                                                             = $::apt::key_options,
   ) {
-
   case $ensure {
     /^(refreshed|present)$/: {
-      if defined(Anchor["apt_key ${id} absent"]){
+      if defined(Anchor["apt_key ${id} absent"]) {
         fail("key with id ${id} already ensured as absent")
       }
 
@@ -76,17 +75,19 @@ define apt::key (
               Apt::Key<| title == $title |>
             }
           }
-          default: { }
+          default: {
+            # Nothing in here
+          }
         }
       }
     }
 
     absent: {
-      if defined(Anchor["apt_key ${id} present"]){
+      if defined(Anchor["apt_key ${id} present"]) {
         fail("key with id ${id} already ensured as present")
       }
 
-      if !defined(Anchor["apt_key ${id} absent"]){
+      if !defined(Anchor["apt_key ${id} absent"]) {
         apt_key { $title:
           ensure   => $ensure,
           id       => $id,
index dfad6b83d9ee96bee41e40cd382f435078533778..f4b7de0a37bf65f4ddbd9342c0d10b1ff8c288c2 100644 (file)
@@ -21,4 +21,3 @@ define apt::mark (
     unless => $unless_cmd,
   }
 }
-
index ae656dbf8f7fde2a8eb5f8c0b94cacf1b629661b..5ef175b713d46b5f7caca0e9102b8aa0958160a4 100644 (file)
@@ -3,7 +3,6 @@
 # @api private
 #
 class apt::params {
-
   if $facts['os']['family'] != 'Debian' {
     fail('This module only works on Debian or derivatives like Ubuntu')
   }
@@ -44,7 +43,7 @@ class apt::params {
     'list'   => {
       'path' => $sources_list_d,
       'ext'  => '.list',
-    }
+    },
   }
 
   $update_defaults = {
@@ -76,7 +75,7 @@ class apt::params {
     'src' => false,
   }
 
-  case $facts['os']['name']{
+  case $facts['os']['name'] {
     'Debian': {
           $backports = {
             'location' => 'http://deb.debian.org/debian',
index 9310653b2d77ea4887a10a022531e8c7599cca2e..c8a45e9d2f36535f1168a3a6d00f857d457ee229 100644 (file)
@@ -33,8 +33,8 @@
 # @param label
 #   Names the label of the packages in the directory tree of the Release file.
 #
-define apt::pin(
-  Optional[Enum['file', 'present', 'absent']] $ensure = present,
+define apt::pin (
+  Enum['file', 'present', 'absent'] $ensure           = present,
   Optional[String] $explanation                       = undef,
   Variant[Integer] $order                             = 50,
   Variant[String, Array] $packages                    = '*',
@@ -48,7 +48,6 @@ define apt::pin(
   Optional[String] $originator                        = '', # o=
   Optional[String] $label                             = '',  # l=
 ) {
-
   if $explanation {
     $_explanation = $explanation
   } else {
index 0d3c7b734cd39f35723c099a26b502bf683c638a..bab7b337e3dbc4918982517e35f520b9b7bcd02d 100644 (file)
@@ -23,7 +23,7 @@
 # @param package_manage
 #   Specifies whether Puppet should manage the package that provides `apt-add-repository`.
 #
-define apt::ppa(
+define apt::ppa (
   String $ensure                 = 'present',
   Optional[String] $options      = $::apt::ppa_options,
   Optional[String] $release      = fact('os.distro.codename'),
index 6757f612260f6e59d5bc53afcc60ba9deedc612b..aa1616162c11b34db8ec2a600c9830cbb4f94580 100644 (file)
 #
 define apt::setting (
   Variant[String, Integer, Array] $priority           = 50,
-  Optional[Enum['file', 'present', 'absent']] $ensure = file,
+  Enum['file', 'present', 'absent'] $ensure           = file,
   Optional[String] $source                            = undef,
   Optional[String] $content                           = undef,
   Boolean $notify_update                              = true,
 ) {
-
   if $content and $source {
     fail('apt::setting cannot have both content and source')
   }
index b24aa346852dc5435d1d3c4011d32a5b7d290a59..fcdc4542143c8641e6f75668d9dce16fc35b6208 100644 (file)
 # @param notify_update
 #   Specifies whether to trigger an `apt-get update` run.
 #
-define apt::source(
+define apt::source (
   Optional[String] $location                    = undef,
   String $comment                               = $name,
   String $ensure                                = present,
   Optional[String] $release                     = undef,
   String $repos                                 = 'main',
-  Optional[Variant[Hash]] $include              = {},
+  Variant[Hash] $include                        = {},
   Optional[Variant[String, Hash]] $key          = undef,
   Optional[Stdlib::AbsolutePath] $keyring       = undef,
   Optional[Variant[Hash, Numeric, String]] $pin = undef,
@@ -73,7 +73,6 @@ define apt::source(
   Boolean $allow_insecure                       = false,
   Boolean $notify_update                        = true,
 ) {
-
   include ::apt
 
   $_before = Apt::Setting["list-${title}"]
@@ -136,12 +135,13 @@ define apt::source(
   $sourcelist = epp('apt/source.list.epp', {
     'comment'          => $comment,
     'includes'         => $includes,
-    'options'          => delete_undef_values({
-      'arch'           => $architecture,
-      'trusted'        => $allow_unsigned ? {true => 'yes', false => undef},
-      'allow-insecure' => $allow_insecure ? {true => 'yes', false => undef},
-      'signed-by'      => $keyring,
-    }),
+    'options'          => delete_undef_values( {
+        'arch'           => $architecture,
+        'trusted'        => $allow_unsigned ? { true => 'yes', false => undef },
+        'allow-insecure' => $allow_insecure ? { true => 'yes', false => undef },
+        'signed-by'      => $keyring,
+      },
+    ),
     'location'         => $_location,
     'release'          => $_release,
     'repos'            => $repos,
index 1ea16afe039eb815c79a4fba87807d39d25e0f8f..256ea7d9bd4265d2d58ba5ea37a6392f23e210df 100644 (file)
@@ -63,6 +63,6 @@ class apt::update {
     refreshonly => $_refresh,
     timeout     => $::apt::_update['timeout'],
     tries       => $::apt::_update['tries'],
-    try_sleep   => 1
+    try_sleep   => 1,
   }
 }