]> gitweb.fluxo.info Git - puppet-wordpress.git/commitdiff
Fix wp-cli install
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 19 Jan 2016 18:13:17 +0000 (16:13 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 19 Jan 2016 18:13:17 +0000 (16:13 -0200)
manifests/init.pp

index 9af4b97fd0dd62d9b5e83788edba89254d0a33c6..f5efdf8a0176c9e25a04893327282f75abca004a 100644 (file)
@@ -1,25 +1,27 @@
 class wordpress {
+  $wp_cli = 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar'
+
   file { "/usr/local/sbin/wordpress":
-    ensure  => present,
-    source  => "puppet:///modules/wordpress/wordpress.sh",
-    owner   => root,
-    group   => root,
-    mode    => 755,
+    ensure => present,
+    source => "puppet:///modules/wordpress/wordpress.sh",
+    owner  => root,
+    group  => root,
+    mode   => 755,
   }
 
   # Composer
   exec { 'getwp':
-    command     => '/usr/bin/wget https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -O /usr/local/bin/wp-cli',
-    user        => 'root',
-    cwd         => '/tmp',
-    creates     => '/usr/local/bin/wp-cli',
+    command => "/usr/bin/wget ${wp_cli} -O /usr/local/bin/wp-cli && chmod +x /usr/local/bin/wp-cli",
+    user    => 'root',
+    cwd     => '/tmp',
+    creates => '/usr/local/bin/wp-cli',
   }
 
   # TODO: remove in the future
   file { "/usr/local/sbin/wp":
-    ensure  => absent,
-    owner   => root,
-    group   => root,
+    ensure => absent,
+    owner  => root,
+    group  => root,
   }
 
   # TODO: remove in the future