Closed guaka closed 10 years ago
Before I forget, I also added a manifests/init.pp
, which seems quite essential:
class wp {
}
[[Uncommenting]] Commenting the Package requirements in cli.pp seems to help:
# Package[ 'curl' ],
# Package[ "$phpprefix-cli" ],
# Package[ 'git' ]
Now I get this though:
err: /Stage[main]/Wp::Cli/Package[]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install ' returned : Reading package lists...
Building dependency tree...
Reading state information...
terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::compare
notice: /Stage[main]//Node[myhost]/Wp::Site[/var/www/mydir]/Exec[wp install /var/www/mydir]: Dependency Package[] has failures: true
warning: /Stage[main]//Node[myhost]/Wp::Site[/var/www/mydir]/Exec[wp install /var/www/mydir]: Skipping because of failed dependencies
notice: Finished catalog run in 3.94 seconds
err: Failed to apply catalog: No title provided and "Package[]" is not a valid resource reference
(All of this is on Ubuntu 12.04.3 LTS.)
Before I forget, I also added a manifests/init.pp, which seems quite essential:
There should already be a manifests/init.pp
in puppet-wp?
Uncommenting the Package requirements in cli.pp seems to help:
There shouldn't be any commented requirements there?
I meant commenting.
re init.pp, weird, I'll clone a clean repo now and see if there are any diffs.
Fresh clone, master branch:
$ wc manifests/init.pp
0 0 0 manifests/init.pp
Yep, it's intentionally blank (it doesn't need to do anything).
What's your full manifest file?
The one for my host?
Yeah, the one you're running puppet apply
on.
import "basenode.pp"
node "myhost" inherits basenode {
include mysql::server
mysql::db { 'mysite':
user => 'mysite',
password => 'randomstuff',
}
# Setup the site
$wplocation = '/var/www/mysite'
notify {$wplocation:}
wp::site {$wplocation:
location => $wplocation,
url => 'http://mysite',
name => 'Mysite',
require => Mysql::Db['mysite']
}
}
I'll try to leave out the subclass stuff next. (once more, I'm really a puppet noob, someone helped me get started :)
ah, it seems indeed that init.pp
can be empty, but then I should not use include wp
, which is also fine, that still leaves the command /usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install
without a package now.
Ah, to avoid
Could not find dependency Package[] for Exec[wp-cli install] at /usr/local/teak-etc/etc/puppet/modules/wp/manifests/cli.pp:48
I only have to uncomment this:
# Package[ "$phpprefix-cli" ],
So I guess the $phpprefix-cli
variable is empty, possibly related to #9 and #12 :)
Either my puppet parses $phpprefix-cli
as a complete variable or $phpprefix
is not set either. But adding this at line 12:
$phpprefix-cli = 'php5-cli'
takes a me step further!
None of the package {}
lines should be commented, same for any of the Package[]
requirements. Doing so will break it.
I tested your configuration and it worked. What version of Puppet are you using?
Default from Ubuntu 12.04.3 LTS
$ puppet --version
2.7.11
$phpprefix
is set, so obviously it's just a problem with Puppet's parsing. Try upgrading to 2.7.19 (which is what I'm running) if you can, otherwise, change the $phpprefix-cli
line to ${phpprefix}-cli
Yay, ${phpprefix}-cli
is much better!
Now I'm just left with:
err: /Stage[main]//Node[myhost]/Wp::Site[/var/www/mysite]/Exec[wp install /var/www/mysite]/returns: change from notrun to 0 failed: Working directory '/var/www/mysite' does not exist
That's likely because the directory doesn't exist. :)
BTW, I thought wp-cli or puppet-wp would take care of mkdir -p
for new sites. I'll add a feature request :)
Nope; puppet-wp is only responsible for running the installation. Your WordPress installation should probably be managed as part of a code repository.
See also #7.
Ah, okay, cool, that clarifies things a bit. I think the current README.md misled me because of the wp::{option|rewrite|plugin}} stuff.
That is: you can do it, but it's not a best practice. :)
eh?