From 85eecfe470274e746df7d776f357fdba2c5de44f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 13 Jul 2021 19:26:14 +0200 Subject: Add way to manage pacman hooks. --- modules/pacman/manifests/init.pp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 modules/pacman/manifests/init.pp (limited to 'modules/pacman/manifests/init.pp') diff --git a/modules/pacman/manifests/init.pp b/modules/pacman/manifests/init.pp new file mode 100644 index 0000000..eadc1c2 --- /dev/null +++ b/modules/pacman/manifests/init.pp @@ -0,0 +1,20 @@ +class pacman ( + String $hooks_path = '/etc/pacman.d/hooks-puppet', + String $conf_path = '/etc/pacman.conf', +) { + + # TODO ability to set multiple settings + ini_setting { 'Pacman HookDir': + path => $conf_path, + section => 'options', + setting => 'HookDir', + value => $hooks_path, + + } + + file { $hooks_path: + ensure => directory, + recurse => true, + purge => true, + } +} -- cgit v1.2.3 From e3c15ec94649c7ba079c3332fc4afc5bda0b4b5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 14 Dec 2021 00:58:22 +0100 Subject: Migrate stuff from ansible. --- modules/pacman/manifests/init.pp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'modules/pacman/manifests/init.pp') 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', + } } -- cgit v1.2.3