Permalink
Browse files

joomla ftp support

  • Loading branch information...
1 parent 12bb9d4 commit ae73e14290c70edec09803361fb506ba2b83681f @alexeyramazanov alexeyramazanov committed Oct 1, 2010
@@ -16,9 +16,13 @@
command "cp /opt/azati/shino/config/metadata.yml /mnt/backup/metadata.yml"
end
+execute "proftpd_backup" do
+ command "cp #{node[:proftpd][:config_path]} /mnt/backup/proftpd.conf"
+end
+
execute "pack_backup" do
cwd "/mnt/backup"
- command "tar -cf backup.tar db.sql.gz site.tar.gz metadata.yml"
+ command "tar -cf backup.tar db.sql.gz site.tar.gz metadata.yml proftpd.conf"
end
file "/mnt/backup/db.sql.gz" do
@@ -35,3 +39,8 @@
action :delete
backup false
end
+
+file "/mnt/backup/proftpd.conf" do
+ action :delete
+ backup false
+end
@@ -1,6 +1,15 @@
+#just know this parameters come from shino
#node[:joomla][:login] = node[:params][:user_name]
node[:joomla][:password] = node[:params][:password]
node[:joomla][:domain_name] = node[:params][:domain_name]
+node[:proftpd][:login] = node[:params][:ftp_login]
+node[:proftpd][:password] = node[:params][:ftp_password]
+
+proftpd_update_password node[:proftpd][:login] do
+ action :update
+ password node[:proftpd][:password]
+ system_login node[:apache][:user]
+end
encrypt_joomla_pass node[:joomla][:password]
@@ -11,17 +11,14 @@
include_recipe "php::php-mbstring"
include_recipe "php::php-gd"
include_recipe "php::php-eaccelerator"
-
-execute "perl -p -i -e 's/display_errors = On/display_errors = Off/' #{node[:php][:dir]}/php.ini" do
- action :run
-end
+include_recipe "proftpd"
service "apache2" do
- action :start
+ action :restart
end
service "mysql" do
- action :start
+ action :restart
end
mysql_reset_root_password
@@ -66,16 +63,20 @@
mode "0644"
end
+execute "chown -R #{node[:apache][:user]}.#{node[:apache][:group]} #{node[:apache][:default_docroot]}" do
+ action :run
+end
+
if node[:azati][:stack]
mysql_command "CREATE USER 'nagios'@'localhost' IDENTIFIED BY 'Nu71QHuSgOtTxXCIYPKJ'" do
action :execute
end
include_recipe "monitoring"
-end
-service "cron" do
- action :enable
+ service "cron" do
+ action :enable
+ end
end
service "apache2" do
@@ -1,39 +0,0 @@
-#node[:joomla][:login] = node[:params][:user_name]
-node[:joomla][:password] = node[:params][:password]
-node[:joomla][:domain_name] = node[:params][:domain_name]
-
-encrypt_joomla_pass node[:joomla][:password]
-
-service "nagios3" do
- action :stop
-end
-
-mysql_reset_root_password
-
-mysql_grant node[:joomla][:db_name] do
- db_login node[:joomla][:db_login]
- db_host node[:joomla][:db_host]
- db_password node[:joomla][:db_password]
- action :run
-end
-
-mysql_command "UPDATE #{node[:joomla][:db_name]}.jos_users SET password='#{node[:joomla][:encrypted_password]}' WHERE name='Administrator';" do
- action :execute
-end
-
-#amazing :/
-bash "update_config" do
- code <<-EOH
-perl -p -i -e "s/var \\\\\\$host =.*/var \\\\\\$host = \'#{node[:joomla][:db_host]}\';/" #{node[:apache][:default_docroot]}/configuration.php
-perl -p -i -e "s/var \\\\\\$user =.*/var \\\\\\$user = \'#{node[:joomla][:db_login]}\';/" #{node[:apache][:default_docroot]}/configuration.php
-perl -p -i -e "s/var \\\\\\$password =.*/var \\\\\\$password = \'#{node[:joomla][:db_password]}\';/" #{node[:apache][:default_docroot]}/configuration.php
-perl -p -i -e "s/var \\\\\\$db =.*/var \\\\\\$db = \'#{node[:joomla][:db_name]}\';/" #{node[:apache][:default_docroot]}/configuration.php
-EOH
-end
-
-joomla_service_web do
- action :restart
-end
-
-log "Joomla User - #{node[:joomla][:login]}"
-log "Joomla Password - #{node[:joomla][:password]}"
@@ -22,10 +22,22 @@
action :execute
end
+execute "proftpd_restore" do
+ command "mv -f /mnt/restore/proftpd.conf #{node[:proftpd][:config_path]}"
+end
+
+execute "chown -R #{node[:apache][:user]}.#{node[:apache][:group]} #{node[:apache][:default_docroot]}" do
+ action :run
+end
+
service "mysql" do
action :restart
end
+service "proftpd" do
+ action :restart
+end
+
joomla_service_web do
action :start
end

0 comments on commit ae73e14

Please sign in to comment.