Puppet Class: cachetool

Inherits:
cachetool::params
Defined in:
manifests/init.pp

Overview

Parameters:

  • phar_location (Any) (defaults to: $cachetool::params::phar_location)
  • target_dir (Any) (defaults to: $cachetool::params::target_dir)
  • command_name (Any) (defaults to: $cachetool::params::command_name)
  • user (Any) (defaults to: $cachetool::params::user)
  • cachetool_adapter (Any) (defaults to: $cachetool::params::cachetool_adapter)
  • cachetool_fastcgi (Any) (defaults to: $cachetool::params::cachetool_fastcgi)
  • cachetool_temp_dir (Any) (defaults to: $cachetool::params::cachetool_temp_dir)


49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'manifests/init.pp', line 49

class cachetool(
    $phar_location      = $cachetool::params::phar_location,
    $target_dir         = $cachetool::params::target_dir,
    $command_name       = $cachetool::params::command_name,
    $user               = $cachetool::params::user,
    $cachetool_adapter  = $cachetool::params::cachetool_adapter,
    $cachetool_fastcgi  = $cachetool::params::cachetool_fastcgi,
    $cachetool_temp_dir = $cachetool::params::cachetool_temp_dir
) inherits cachetool::params {

    # Download the cachetool package
    wget::fetch { 'cachetool_phar':
        source      => $phar_location,
        destination => "${target_dir}/${command_name}",
        verbose     => false
    }

    # Set proper permissions if needed
    exec { 'cachetool_set_permissions':
        command => "chmod a+x ${command_name}",
        path    => '/usr/bin:/bin:/usr/sbin:/sbin',
        cwd     => $target_dir,
        user    => $user,
        unless  => "test -x ${target_dir}/${command_name}",
        require => Wget::Fetch['cachetool_phar']
    }

    # Set configuration settings
    file { 'cachetool_yml':
        path    => '/etc/cachetool.yml',
        ensure  => file,
        content => template('cachetool/cachetool.yml.erb'),
        owner   => 'root',
        group   => 'root',
        mode    => '0644'
    }
}