brint / wordpress-cookbook

Development repository for Opscode Cookbook wordpress
https://supermarket.chef.io/cookbooks/wordpress
Apache License 2.0
80 stars 176 forks source link

Multiple WP on same host #33

Closed vic3lord closed 5 years ago

vic3lord commented 10 years ago

You can't use this cookbook as a wrapper cookbook and it can't be used for multiple installs on the same host as it uses attributes to install.

There should be LWRPs to install wordpress site

brint commented 10 years ago

@vic3lord Thanks for the suggestion. I'll leave this issue open for comments and ideas. PR's are welcome to help in building the LWRP.

brint commented 9 years ago

I've put up a draft in the lib branch. It is following the convention of most of the community cookbooks that are turning more into libraries.

Sample usage for installing two sites from tarball on the same machine:

# The following installs the latest version of WordPress to /var/www/wordpress
wordpress_install 'default' do
  action :create
end

# Here's a second installation to a different path that installs a different version 
# of WordPress. Additionally the user/group settings are different since you 
# may have different users that need permissions/access to different sites.
wordpress_install 'example2.com' do
  install_method 'tarball'  # this is the default install_method
  install_path '/var/www/example2.com'
  version '3.9.3'
  owner 'www-data'
  group 'www-data'
  action :create
end

Another installation option is via unauthenticated git, inspired by #51.

# Defaults to master ref and syncs to /var/www/wordpress
wordpress_install 'default' do
  install_method 'git'
  action :create
end

wordpress_install 'example2.com' do
  install_method 'git'
  install_path '/var/www/example2.com'
  reference '3.9.3'
  owner 'www-data'
  group 'www-data'
  action :create
end

I've put in some basic tests as well. Once I change out how WordPress is installed in the wordpress::app, I'll merge it into master and cut a new release. This sounds like it should fit what you were looking for.

dmyers commented 9 years ago

:+1: