Skip to content

Instantly share code, notes, and snippets.

@miya0001
Created December 11, 2013 16:12
Show Gist options
  • Save miya0001/7913287 to your computer and use it in GitHub Desktop.
Save miya0001/7913287 to your computer and use it in GitHub Desktop.
3.8-RC2-ja用のVagrantfile VCCWの中に放り込んでから使って下さい。 https://github.com/miya0001/vagrant-chef-centos-wordpress
# encoding: utf-8
# vim: ft=ruby expandtab shiftwidth=2 tabstop=2
VAGRANTFILE_API_VERSION = "2"
#
# Configuration for the WordPress
#
WP_VERSION = '3.8-RC2' # latest or 3.4 or later or http(s):// URL to zipfile
WP_LANG = "ja" # WordPress locale (e.g. ja)
WP_HOSTNAME = "wordpress.local" # e.g example.com
WP_IP = "192.168.33.10" # host ip address
WP_TITLE = "Welcome to the Vagrant" # title
WP_ADMIN_USER = "admin" # default user
WP_ADMIN_PASS = "admin" # default user's password
WP_DB_PREFIX = 'wp_' # Database prefix
WP_DEFAULT_PLUGINS = %w(theme-check plugin-check hotfix) # default plugins
WP_DEFAULT_THEME = '' # e.g. twentythirteen
WP_DIR = '' # e.g. /wp or wp or other
WP_IS_MULTISITE = false # enable multisite when true
WP_FORCE_SSL_ADMIN = false # enable force ssl admin when true
WP_DEBUG = true # enable debug mode
WP_SAVEQUERIES = false # save the database queries to an array
WP_THEME_UNIT_TEST = true # automatic import theme unit test data
WP_ALWAYS_RESET = true # always reset database
WP_CHEF_COOKBOOKS_PATH = Dir.pwd # path to the cookbooks (e.g. ~/vagrant-local)
if WP_LANG === 'ja' then
WP_THEME_UNIT_TEST_DATA_URI = 'https://raw.github.com/jawordpressorg/theme-test-data-ja/v1.0/wordpress-theme-test-date-ja.xml'
else
WP_THEME_UNIT_TEST_DATA_URI = 'https://wpcom-themes.svn.automattic.com/demo/theme-unit-test-data.xml'
end
# end configuration
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "cent64_minimal_i386"
config.vm.box_url = "http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-i386-v20130427.box"
config.vm.hostname = WP_HOSTNAME
config.vm.network :private_network, ip: WP_IP
config.vm.synced_folder "www/", "/var/www", :create => "true"
config.hostsupdater.remove_on_suspend = true
# for CentOS ipv6 issue
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--natdnsproxy1", "off"]
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "off"]
end
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = [
File.join(WP_CHEF_COOKBOOKS_PATH, "cookbooks"),
File.join(WP_CHEF_COOKBOOKS_PATH, "site-cookbooks")
]
chef.json = {
:apache => {
:docroot_dir => '/var/www/wordpress',
:user => 'vagrant',
:group => 'vagrant',
:listen_ports => ["80", "443"]
},
:php => {
:packages => %w(php php-cli php-devel php-mbstring php-gd php-xml php-mysql)
},
:mysql => {
:bind_address => "0.0.0.0",
:server_debian_password => "wordpress",
:server_root_password => "wordpress",
:server_repl_password => "wordpress"
},
:"wp-install" => {
:wp_version => WP_VERSION,
:url => "http://" << File.join(WP_HOSTNAME, WP_DIR),
:wpdir => File.join('/var/www/wordpress', WP_DIR),
:locale => WP_LANG,
:admin_user => WP_ADMIN_USER,
:admin_password => WP_ADMIN_PASS,
:dbprefix => WP_DB_PREFIX,
:default_plugins => WP_DEFAULT_PLUGINS,
:default_theme => WP_DEFAULT_THEME,
:title => WP_TITLE,
:is_multisite => WP_IS_MULTISITE,
:force_ssl_admin => WP_FORCE_SSL_ADMIN,
:debug_mode => WP_DEBUG,
:savequeries => WP_SAVEQUERIES,
:theme_unit_test => WP_THEME_UNIT_TEST,
:theme_unit_test_data_url => WP_THEME_UNIT_TEST_DATA_URI,
:always_reset => WP_ALWAYS_RESET,
:dbhost => WP_IP
}
}
chef.add_recipe "yum::epel"
chef.add_recipe "iptables"
chef.add_recipe "apache2"
chef.add_recipe "apache2::mod_php5"
chef.add_recipe "apache2::mod_ssl"
chef.add_recipe "mysql::server"
chef.add_recipe "mysql::ruby"
chef.add_recipe "php::package"
chef.add_recipe "wp-cli"
chef.add_recipe "wp-install"
chef.add_recipe "wp-i18n"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment