Puppet Class: yum::plugin::post_transaction_actions

Defined in:
manifests/plugin/post_transaction_actions.pp

Summary

Class to install post_transaction plugin

Overview

Examples:

Enable post_transaction_action plugin

class{'yum::plugin::post_transaction_actions':
  ensure => present,
}

Parameters:

  • ensure (Enum['present', 'absent']) (defaults to: 'present')

    Should the post_transaction actions plugin be installed

See Also:



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'manifests/plugin/post_transaction_actions.pp', line 12

class yum::plugin::post_transaction_actions (
  Enum['present', 'absent'] $ensure = 'present',
) {
  if $facts['package_provider'] == 'yum' {
    $_pkg_prefix  = undef
    $_actionfile = '/etc/yum/post-actions/puppet_maintained.action'
  } else {
    $_pkg_prefix  = 'python3-dnf-plugin'
    $_actionfile = '/etc/dnf/plugins/post-transaction-actions.d/puppet_maintained.action'
  }

  yum::plugin { 'post-transaction-actions':
    ensure     => $ensure,
    pkg_prefix => $_pkg_prefix,
  }

  if $ensure == 'present' {
    concat { 'puppet_actions':
      ensure => present,
      path   => $_actionfile,
      owner  => root,
      group  => root,
      mode   => '0644',
    }

    concat::fragment { 'action_header':
      target  => 'puppet_actions',
      content => "# Puppet maintained actions\n# \$key:\$state:\$command\n\n",
      order   => '01',
    }
  }
}