obbistrano 1.0.83 → 1.0.84

Sign up to get free protection for your applications and to get access to all the features.
@@ -336,16 +336,37 @@ Capistrano::Configuration.instance(:must_exist).load do
336
336
  desc "Sets up the server with a user, home directory and mysql login."
337
337
  task :setup do
338
338
  config_check
339
- try_login
340
- "#{server_type}".setup
339
+ setup_user
340
+ vhost
341
+ setup_mysql
341
342
  end
342
343
 
343
344
  desc "Restarts the web server."
344
345
  task :restart do
345
- server_type.restart
346
+ s_namespace = eval(server_type)
347
+ s_namespace.restart
348
+ end
349
+
350
+ desc "Creates a new Apache VHost."
351
+ task :vhost do
352
+ config_check
353
+ needs_root
354
+ s_namespace = eval(server_type)
355
+ s_namespace.vhost
356
+ s_namespace.restart
357
+ end
358
+
359
+ desc "Sets up a new user."
360
+ task :setup_user do
361
+ config_check
362
+ needs_root
363
+ try_login
364
+ s_namespace = eval(server_type)
365
+ s_namespace.setup_user
346
366
  end
347
367
 
348
368
 
369
+
349
370
  ###### Private tasks for server operations #############
350
371
 
351
372
  task :config_check do
@@ -411,14 +432,7 @@ Capistrano::Configuration.instance(:must_exist).load do
411
432
 
412
433
  namespace :ubuntu do
413
434
 
414
- task :setup do
415
- vhost
416
- setup_user
417
- host.setup_mysql
418
- end
419
-
420
435
  task :setup_user do
421
- host.needs_root
422
436
  set :user_to_add, "#{user}"
423
437
  set :passwd_to_add, "#{password}"
424
438
  with_user("root", "#{root_pass}") do
@@ -428,8 +442,6 @@ Capistrano::Configuration.instance(:must_exist).load do
428
442
  end
429
443
 
430
444
  task :vhost do
431
- host.config_check
432
- host.needs_root
433
445
  with_user("root", "#{root_pass}") do
434
446
  public_ip = ""
435
447
  run "ifconfig eth0 | grep inet | awk '{print $2}' | sed 's/addr://'" do |_, _, public_ip| end
@@ -443,12 +455,9 @@ Capistrano::Configuration.instance(:must_exist).load do
443
455
  put config, "/etc/apache2/sites-enabled/#{webserver}-apache-vhost.conf"
444
456
  end
445
457
  end
446
- server.restart
447
458
  end
448
459
 
449
460
  task :restart do
450
- host.config_check
451
- host.needs_root
452
461
  with_user("root", "#{root_pass}") do
453
462
  run "/etc/init.d/apache2 restart"
454
463
  end
@@ -458,14 +467,7 @@ Capistrano::Configuration.instance(:must_exist).load do
458
467
 
459
468
  namespace :fedora do
460
469
 
461
- task :setup do
462
- vhost
463
- setup_user
464
- host.setup_mysql
465
- end
466
-
467
470
  task :setup_user do
468
- host.needs_root
469
471
  set :user_to_add, "#{user}"
470
472
  set :passwd_to_add, "#{password}"
471
473
  with_user("root", "#{root_pass}") do
@@ -475,8 +477,6 @@ Capistrano::Configuration.instance(:must_exist).load do
475
477
  end
476
478
 
477
479
  task :vhost do
478
- host.config_check
479
- host.needs_root
480
480
  with_user("root", "#{root_pass}") do
481
481
  public_ip = ""
482
482
  run "ifconfig eth0 | grep inet | awk '{print $2}' | sed 's/addr://'" do |_, _, public_ip| end
@@ -490,12 +490,9 @@ Capistrano::Configuration.instance(:must_exist).load do
490
490
  put config, "/etc/httpd/conf.d/#{webserver}-apache-vhost.conf"
491
491
  end
492
492
  end
493
- restart
494
493
  end
495
494
 
496
495
  task :restart do
497
- host.config_check
498
- host.needs_root
499
496
  with_user("root", "#{root_pass}") do
500
497
  run "/etc/rc.d/init.d/httpd restart"
501
498
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{obbistrano}
5
- s.version = "1.0.83"
5
+ s.version = "1.0.84"
6
6
  s.authors = ["Ross Riley", "One Black Bear"]
7
7
  s.date = Time.now
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: obbistrano
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.83
4
+ version: 1.0.84
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ross Riley