obbistrano 1.1.21 → 1.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -373,44 +373,9 @@ Capistrano::Configuration.instance(:must_exist).load do
373
373
 
374
374
  end
375
375
 
376
- namespace :ubuntu do
377
-
378
- task :setup_user do
379
- set :user_to_add, "#{user}"
380
- set :passwd_to_add, "#{password}"
381
- with_user("root", "#{root_pass}") do
382
- run "useradd -d /home/#{user_to_add} -p `openssl passwd #{passwd_to_add}` -m #{user_to_add}"
383
- run "chmod -R 0755 /home/#{user_to_add}"
384
- end
385
- end
386
-
387
- task :vhost do
388
- with_user("root", "#{root_pass}") do
389
- public_ip = ""
390
- run "ifconfig eth0 | grep inet | awk '{print $2}' | sed 's/addr://'" do |_, _, public_ip| end
391
- public_ip = public_ip.strip
392
- roles[:web].servers.each do |webserver|
393
- f = File.open(File.join(File.dirname(__FILE__), 'templates/apache_vhost.erb' ))
394
- contents = f.read
395
- f.close
396
- buffer = ERB.new(contents)
397
- config = buffer.result(binding())
398
- put config, "/etc/apache2/sites-enabled/#{webserver}-apache-vhost.conf"
399
- end
400
- end
401
- end
402
-
403
- task :restart do
404
- with_user("root", "#{root_pass}") do
405
- run "/etc/init.d/apache2 restart"
406
- end
407
- end
408
-
409
- end
410
-
411
376
  namespace :fedora do
412
377
 
413
- task :setup_user do
378
+ task :setup_user, :roles =>[:host] do
414
379
  set :user_to_add, "#{user}"
415
380
  set :passwd_to_add, "#{password}"
416
381
  with_user("root", "#{root_pass}") do
@@ -419,7 +384,7 @@ Capistrano::Configuration.instance(:must_exist).load do
419
384
  end
420
385
  end
421
386
 
422
- task :vhost do
387
+ task :vhost, :roles =>[:host] do
423
388
  with_user("root", "#{root_pass}") do
424
389
  public_ip = ""
425
390
  run "ifconfig eth0 | grep inet | awk '{print $2}' | sed 's/addr://'" do |_, _, public_ip| end
@@ -435,7 +400,7 @@ Capistrano::Configuration.instance(:must_exist).load do
435
400
  end
436
401
  end
437
402
 
438
- task :restart do
403
+ task :restart, :roles =>[:host] do
439
404
  with_user("root", "#{root_pass}") do
440
405
  run "/etc/init.d/httpd restart"
441
406
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{obbistrano}
5
- s.version = "1.1.21"
5
+ s.version = "1.1.22"
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.1.21
4
+ version: 1.1.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ross Riley