Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find dependency Package[] for Exec[wp-cli install] at modules/wp/manifests/cli.pp:48 #11

Closed
guaka opened this issue Dec 7, 2013 · 23 comments

Comments

@guaka
Copy link

guaka commented Dec 7, 2013

Could not find dependency Package[] for Exec[wp-cli install] at modules/wp/manifests/cli.pp:48

eh?

@guaka
Copy link
Author

guaka commented Dec 8, 2013

Before I forget, I also added a manifests/init.pp, which seems quite essential:

class wp {

}

@guaka
Copy link
Author

guaka commented Dec 8, 2013

[[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

@guaka
Copy link
Author

guaka commented Dec 8, 2013

(All of this is on Ubuntu 12.04.3 LTS.)

@rmccue
Copy link
Collaborator

rmccue commented Dec 8, 2013

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?

@guaka
Copy link
Author

guaka commented Dec 8, 2013

I meant commenting.

re init.pp, weird, I'll clone a clean repo now and see if there are any diffs.

@guaka
Copy link
Author

guaka commented Dec 8, 2013

Fresh clone, master branch:

$ wc manifests/init.pp
0 0 0 manifests/init.pp

@rmccue
Copy link
Collaborator

rmccue commented Dec 8, 2013

Yep, it's intentionally blank (it doesn't need to do anything).

What's your full manifest file?

@guaka
Copy link
Author

guaka commented Dec 8, 2013

The one for my host?

@rmccue
Copy link
Collaborator

rmccue commented Dec 8, 2013

Yeah, the one you're running puppet apply on.

@guaka
Copy link
Author

guaka commented Dec 8, 2013

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 :)

@guaka
Copy link
Author

guaka commented Dec 8, 2013

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.

@guaka
Copy link
Author

guaka commented Dec 8, 2013

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 :)

@guaka
Copy link
Author

guaka commented Dec 8, 2013

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!

@rmccue
Copy link
Collaborator

rmccue commented Dec 8, 2013

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?

@guaka
Copy link
Author

guaka commented Dec 8, 2013

Default from Ubuntu 12.04.3 LTS

$ puppet --version
2.7.11

@rmccue
Copy link
Collaborator

rmccue commented Dec 8, 2013

$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

@guaka
Copy link
Author

guaka commented Dec 8, 2013

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

@rmccue
Copy link
Collaborator

rmccue commented Dec 8, 2013

That's likely because the directory doesn't exist. :)

@rmccue rmccue closed this as completed in a9f0390 Dec 8, 2013
@guaka
Copy link
Author

guaka commented Dec 8, 2013

BTW, I thought wp-cli or puppet-wp would take care of mkdir -p for new sites. I'll add a feature request :)

@rmccue
Copy link
Collaborator

rmccue commented Dec 8, 2013

Nope; puppet-wp is only responsible for running the installation. Your WordPress installation should probably be managed as part of a code repository.

@rmccue
Copy link
Collaborator

rmccue commented Dec 8, 2013

See also #7.

@guaka
Copy link
Author

guaka commented Dec 8, 2013

Ah, okay, cool, that clarifies things a bit. I think the current README.md misled me because of the wp::{option|rewrite|plugin}} stuff.

@rmccue
Copy link
Collaborator

rmccue commented Dec 8, 2013

That is: you can do it, but it's not a best practice. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants