<commit_before>#
# Cookbook Name:: lnmp_aio
# Recipe:: setup_lnmp_aio
#
# Copyright 2012, <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

rightscale_marker :begin

# Preset some things that are in external cookbooks
# TODO: Should have the storage mountpoint be a variable or input somewhere
mountpoint = "/mnt/storage"
# node[:app_wordpress][:version_store_path] = ::File.join(mountpoint, "wordpress-home", "versions")

DATA_DIR = ::File.join(mountpoint, 'mysql')

directory DATA_DIR do
  action :create
end

log "  Stopping database..."
db mountpoint do
  action :stop
end

log "  Moving database to block device and starting database..."
db mountpoint do
  data_dir DATA_DIR
  action [ :move_data_dir, :start ]
end

log "  Setting state of database to be 'initialized'..."
db_init_status :set

# Set master node variables
db_state_set "Set master state" do
  master_uuid node[:rightscale][:instance_uuid]
  master_ip node[:cloud][:private_ips][0]
  is_master true
end

if node[:platform] == "ubuntu"
  node[:php5][:module_list] += " curl" unless node[:php5][:module_list] =~ /curl/
  node[:php5][:module_list] += " fileinfo" unless node[:php5][:module_list] =~ /fileinfo/
end

include_recipe "nginx::install_from_package"
include_recipe "nginx::setup_stats"
include_recipe "php5::install_php"
include_recipe "php5::install_fpm"
include_recipe "php5::setup_fpm_nginx"
include_recipe "php5::setup_fpmstats_nginx"
include_recipe "mail_postfix::setup_postfix"<commit_msg>Revert changes that add db manager functionality after confirming that there is no DB file consistency magic going on<commit_after>#
# Cookbook Name:: lnmp_aio
# Recipe:: setup_lnmp_aio
#
# Copyright 2012, <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

rightscale_marker :begin

# Preset some things that are in external cookbooks
# TODO: Should have the storage mountpoint be a variable or input somewhere
mountpoint = "/mnt/storage"
# node[:app_wordpress][:version_store_path] = ::File.join(mountpoint, "wordpress-home", "versions")

DATA_DIR = ::File.join(mountpoint, 'mysql')

directory DATA_DIR do
  action :create
end

log "  Stopping database..."
db mountpoint do
  action :stop
end

log "  Moving database to block device and starting database..."
db mountpoint do
  data_dir DATA_DIR
  action [ :move_data_dir, :start ]
end

if node[:platform] == "ubuntu"
  node[:php5][:module_list] += " curl" unless node[:php5][:module_list] =~ /curl/
  node[:php5][:module_list] += " fileinfo" unless node[:php5][:module_list] =~ /fileinfo/
end

include_recipe "nginx::install_from_package"
include_recipe "nginx::setup_stats"
include_recipe "php5::install_php"
include_recipe "php5::install_fpm"
include_recipe "php5::setup_fpm_nginx"
include_recipe "php5::setup_fpmstats_nginx"
include_recipe "mail_postfix::setup_postfix"
{'fraction_non_alphanumeric': 0.10176176702603208, 'fraction_numerical': 0.008677359978963977, 'mean_word_length': 5.480408858603067, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2391772', 'n_tokens_mistral': 1193, 'n_tokens_neox': 1168, 'n_words': 401}