Code Monkey home page Code Monkey logo

Comments (23)

guaka avatar guaka commented on August 28, 2024

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

class wp {

}

from puppet-wp.

guaka avatar guaka commented on August 28, 2024

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

from puppet-wp.

guaka avatar guaka commented on August 28, 2024

(All of this is on Ubuntu 12.04.3 LTS.)

from puppet-wp.

rmccue avatar rmccue commented on August 28, 2024

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?

from puppet-wp.

guaka avatar guaka commented on August 28, 2024

I meant commenting.

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

from puppet-wp.

guaka avatar guaka commented on August 28, 2024

Fresh clone, master branch:

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

from puppet-wp.

rmccue avatar rmccue commented on August 28, 2024

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

What's your full manifest file?

from puppet-wp.

guaka avatar guaka commented on August 28, 2024

The one for my host?

from puppet-wp.

rmccue avatar rmccue commented on August 28, 2024

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

from puppet-wp.

guaka avatar guaka commented on August 28, 2024
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 :)

from puppet-wp.

guaka avatar guaka commented on August 28, 2024

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.

from puppet-wp.

guaka avatar guaka commented on August 28, 2024

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

from puppet-wp.

guaka avatar guaka commented on August 28, 2024

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!

from puppet-wp.

rmccue avatar rmccue commented on August 28, 2024

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?

from puppet-wp.

guaka avatar guaka commented on August 28, 2024

Default from Ubuntu 12.04.3 LTS

$ puppet --version
2.7.11

from puppet-wp.

rmccue avatar rmccue commented on August 28, 2024

$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

from puppet-wp.

guaka avatar guaka commented on August 28, 2024

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

from puppet-wp.

rmccue avatar rmccue commented on August 28, 2024

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

from puppet-wp.

guaka avatar guaka commented on August 28, 2024

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

from puppet-wp.

rmccue avatar rmccue commented on August 28, 2024

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

from puppet-wp.

rmccue avatar rmccue commented on August 28, 2024

See also #7.

from puppet-wp.

guaka avatar guaka commented on August 28, 2024

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

from puppet-wp.

rmccue avatar rmccue commented on August 28, 2024

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

from puppet-wp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.