Le vendredi 24 novembre 2017 à 17:29 +0100, Henrik Lindberg a écrit :
> On 24/11/17 16:09, mattf...@gmail.com wrote:
> > Hi, this looks like lots of code and could be more efficient (Zesty & 
> > Xenial )?
> >
> 
> You have quite a lot of repetition - you can fix that by using
> a default section for your resources. It is a bit of work to find
> all repeated settings so I am only showing it in principle:
> 

Even better, you could pass the `$xenial_defaults` variable to create_resource:

```
$xenial_defaults = {
  release    => 'xenial',
  repos      => ['main', 'restricted'],
  with_udebs => true,
  key        => ['40976EAF437D05B5','3B4FE6ACC0B21F32'],
  # and so on...
}

$mirrors = {
  'xenial_main' => {
    # keys that differ or additional keys
  },
  'xenial_main_updates' => {
    'release' => 'xenial-updates',
    # keys that differ or additional keys
  },
  # etc, etc
}

create_resources('::apt::source', $mirrors, $xenial_defaults)
```

-- 
Johan Fleury
PGP Key ID : 0x5D404386805E56E6

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/1512225081.2638.4.camel%40arcaik.net.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to