diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-07-13 19:26:14 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-07-13 19:29:10 +0200 |
commit | e7559e868775b54f59968bb4a18a246bea9108ea (patch) | |
tree | 1de22ad6d303fb0c3d6429f48f7a96a5c721580d /templates | |
download | pacman-e7559e868775b54f59968bb4a18a246bea9108ea.tar.gz pacman-e7559e868775b54f59968bb4a18a246bea9108ea.tar.xz |
Add way to manage pacman hooks.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/hook.epp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/templates/hook.epp b/templates/hook.epp new file mode 100644 index 0000000..08377d9 --- /dev/null +++ b/templates/hook.epp @@ -0,0 +1,31 @@ +<%- | Array[Pacman::Trigger] $triggers, + Optional[String] $description, + String $exec, + Enum['PreTransation', 'PostTransaction'] $when, + Array[String] $depends, + Boolean $abortOnFail, + Boolean $needsTargets, + +| -%> +# Managed by Puppet + +[Trigger] +<%- $triggers.each |$trigger| { -%> +Type = <%= $trigger['type'] %> +<%- $trigger['operation'].each |$op| { -%> +Operation = <%= $op %> +<%- } -%> +<% $trigger['target'].each |$target| { -%> +Target = <%= $target %> +<%- } -%> +<%- } %> + +[Action] +<%- if ($description) { -%>Description = <%= $description %><% } %> +Exec = <%= $exec %> +When = <%= $when %> +<%- $depends.each |$depend| { -%> +Depends = <%= $depend %> +<%- } -%> +<%- if ($abortOnFail) { -%>AbortOnFail<% } %> +<%- if ($needsTargets) { -%>NeedsTargets<% } %> |