summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/init.pp29
1 files changed, 23 insertions, 6 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 9b65050..e992d7f 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -6,7 +6,14 @@
# @param ilovecandy
# It's a secret to everybody.
# @param parallel_downloads
-# @param mirrorlist
+# @param mirrorlist_source
+# Contents of default mirrorlist file.
+# Mutually exclusive with $mirrorlist_content.
+# @param mirrorlist_content
+# Source url of default mirrorlist file.
+# Mutually exclusive with $mirrorlist_source.
+# @param mirrorlist_file
+# Path to default mirrorlist file.
# @param update
# Should 'pacman -Sy' be run after changes to the configuration?
# @param include_default
@@ -16,7 +23,9 @@ class pacman (
String $conf_path = '/etc/pacman.conf',
Boolean $ilovecandy = false,
Optional[Integer] $parallel_downloads = undef,
- String $mirrorlist = "puppet:///modules/${module_name}/mirrorlist",
+ Optional[String] $mirrorlist_source = undef,
+ Optional[String] $mirrorlist_content = undef,
+ String $mirrorlist_file = '/etc/pacman.d/mirrorlist',
Boolean $update = false,
Boolean $include_default = true,
) {
@@ -56,14 +65,22 @@ class pacman (
purge => true,
}
- file { '/etc/pacman.d/mirrorlist':
- backup => true,
- source => $mirrorlist,
+ if $mirrorlist_source == undef and $mirrorlist_content == undef {
+ file { $mirrorlist_file:
+ backup => true,
+ source => "puppet:///modules/${module_name}/mirrorlist",
+ }
+ } else {
+ file { $mirrorlist_file:
+ backup => true,
+ source => $mirrorlist_source,
+ content => $mirrorlist_content,
+ }
}
if $include_default {
pacman::repo { ['core', 'extra', 'community']:
- include => '/etc/pacman.d/mirrorlist',
+ include => $mirrorlist_file,
}
}
}