summaryrefslogtreecommitdiff
path: root/modules/pacman/manifests
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2021-12-14 00:58:22 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2021-12-14 02:16:16 +0100
commite3c15ec94649c7ba079c3332fc4afc5bda0b4b5a (patch)
tree215c9048c49c5fbcab9484893024b0bd42f74d9f /modules/pacman/manifests
parentMerge branch 'raspi' (diff)
downloadwebdav_server-e3c15ec94649c7ba079c3332fc4afc5bda0b4b5a.tar.gz
webdav_server-e3c15ec94649c7ba079c3332fc4afc5bda0b4b5a.tar.xz
Migrate stuff from ansible.
Diffstat (limited to 'modules/pacman/manifests')
-rw-r--r--modules/pacman/manifests/init.pp26
-rw-r--r--modules/pacman/manifests/repo.pp24
2 files changed, 49 insertions, 1 deletions
diff --git a/modules/pacman/manifests/init.pp b/modules/pacman/manifests/init.pp
index eadc1c2..fb23328 100644
--- a/modules/pacman/manifests/init.pp
+++ b/modules/pacman/manifests/init.pp
@@ -1,9 +1,9 @@
class pacman (
String $hooks_path = '/etc/pacman.d/hooks-puppet',
String $conf_path = '/etc/pacman.conf',
+ Boolean $ilovecandy = false,
) {
- # TODO ability to set multiple settings
ini_setting { 'Pacman HookDir':
path => $conf_path,
section => 'options',
@@ -12,9 +12,33 @@ class pacman (
}
+ ini_setting { 'Pacman ILoveCandy':
+ ensure => if ($ilovecandy) { present } else { absent },
+ path => '/etc/pacman.conf',
+ section => 'options',
+ setting => 'ILoveCandy',
+ key_val_separator => '',
+ value => '',
+ }
+
+ if versioncmp($facts['pacman-version'], '6.0.0') >= 0 {
+ ini_setting { 'Pacman parallel downloads':
+ path => '/etc/pacman.conf',
+ section => 'options',
+ setting => 'ParallelDownloads',
+ value => 8,
+ }
+ }
+
file { $hooks_path:
ensure => directory,
recurse => true,
purge => true,
}
+
+ file { '/etc/pacman.d/mirrorlist':
+ ensure => present,
+ backup => true,
+ source => 'puppet:///modules/pacman/mirrorlist',
+ }
}
diff --git a/modules/pacman/manifests/repo.pp b/modules/pacman/manifests/repo.pp
new file mode 100644
index 0000000..28f92b0
--- /dev/null
+++ b/modules/pacman/manifests/repo.pp
@@ -0,0 +1,24 @@
+define pacman::repo (
+ Enum['present', 'absent'] $ensure = 'present',
+ String $repo_name = $name,
+ # String $include,
+ String $server,
+ String $sig_level,
+) {
+
+ ini_setting {
+ default:
+ ensure => $ensure,
+ path => $::pacman::conf_path,
+ section => $repo_name ,
+ ;
+ "Pacman repo [${repo_name}] server":
+ setting => 'Server',
+ value => $server ,
+ ;
+ "Pacman repo [${repo_name}] SigLevel":
+ setting => 'SigLevel',
+ value => $sig_level ,
+ ;
+ }
+}