summaryrefslogtreecommitdiff
path: root/manifests/init.pp
blob: 38bb1337ddbe7c17cd2b42c9613b0b026db65fc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class wordpress {
  $wp_cli = 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar'

  include php::composer

  file { "/usr/local/bin/wordpress":
    ensure => present,
    source => "puppet:///modules/wordpress/wordpress.sh",
    owner  => root,
    group  => root,
    mode   => '755',
  }

  # Wordpress command line
  exec { 'getwp':
    command => "/usr/bin/wget ${wp_cli} -O /usr/local/bin/wp && chmod +x /usr/local/bin/wp",
    user    => 'root',
    cwd     => '/tmp',
    creates => '/usr/local/bin/wp',
    require => Exec['getcomposer'],
  }

  # Old location
  file { '/usr/local/bin/wp-cli':
    ensure => absent,
  }
}