Puppet Class: wordpress::cli

Defined in:
manifests/cli.pp

Summary

Install lastest WP-CLI tool.

Overview

Note:

This class should be considered as private.

Parameters:

  • wpcli_url (Pattern['^http'])

    http URL where to download the wpcli tool.

  • wpcli_bin (Pattern['^/'])

    The PATH where the wpcli tools is deployed.

  • ensure (Enum['present','absent']) (defaults to: $wordpress::params::default_wpcli_ensure)

    The desirated state about wpcli tools. Valid values are ‘present’, ‘absent’. Defaults to ‘present’.



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
44
45
46
47
# File 'manifests/cli.pp', line 12

class wordpress::cli (
  Pattern['^http'] $wpcli_url,
  Pattern['^/'] $wpcli_bin,
  Enum['present','absent'] $ensure = $wordpress::params::default_wpcli_ensure,
) {

  case $ensure {
    'present': {

      archive { 'wpcli_bin' :
        ensure => present,
        path   => $wpcli_bin,
        source => $wpcli_url,
        user   => 0,
        group  => 0,
      }
      ->
      file { $wpcli_bin :
        ensure => file,
        owner  => 0,
        group  => 0,
        mode   => '0755',
      }

    }
    'absent': {
      file { $wpcli_bin :
        ensure => absent,
      }
    }
    default: {
      fail('unexpected value for ensure parameter')
    }
  }

}