capistrano-ubuntu 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b3a12fc31c7528833b14353ab7a953d264345a7
4
- data.tar.gz: 53665f5534071752032d3fc7859dcd4c3ce8fa95
3
+ metadata.gz: 5cd54a5977ac3798987382aef4ff2cc5585e75fb
4
+ data.tar.gz: 388a9e1767d8bdee9779e645b411ab011b0243f7
5
5
  SHA512:
6
- metadata.gz: 200f4000c6bd0bbfd05512ed3a241ceb6592d691c9eca51f881b206d78e08eb0601b54b6ef70e31a5877482e220eddfcbe65d8d7a0823d1d701a4f27038aad74
7
- data.tar.gz: f6a301d10ab114b25d66363237d9377404c54552a14acb23b57d515915fc25feec4f369103ffbd8c1a590635fd4b6208ee7bbf66aff69b15f5c4c70d56c5d934
6
+ metadata.gz: 16ed2d85b92b07753f8a99fd82938c45bcbe592facf7cb496b95003ffe072f4bfaf4a934a94daec93cbdbd00afb68ae1a289a23aeff4b67056c9dd1af5e21c92
7
+ data.tar.gz: 3090ed6f081309cb3450c2e6526b1ac62f64515ecaa8fe5df1e3e08310f50007b410835a8112e84c4daa8d8986ff8a4edcaedcb1a3c9c1ba62fbedf04f3fa19f
@@ -12,6 +12,7 @@ default_ubuntu_packages = %w[
12
12
  git
13
13
  lsof
14
14
  ufw
15
+ ntp
15
16
  ]
16
17
 
17
18
 
@@ -24,8 +25,11 @@ namespace :ubuntu do
24
25
 
25
26
  task :update_sources do
26
27
 
27
- on roles(:all) do
28
- fetch(:ubuntu_software_sources).each do |source|
28
+ on roles(:all) do |server|
29
+
30
+ sources = server.roles.map { |role| fetch(:"ubuntu_software_sources_for_#{role}",[])}.flatten + fetch(:ubuntu_software_sources)
31
+
32
+ sources.each do |source|
29
33
 
30
34
  if source.is_a? Array
31
35
  execute "wget --quiet -O - #{source.last} | sudo apt-key add -"
@@ -41,9 +45,12 @@ namespace :ubuntu do
41
45
 
42
46
  task :install_packages do
43
47
 
44
- packages = default_ubuntu_packages + fetch(:ubuntu_packages)
45
48
 
46
- on roles(:all) do
49
+
50
+ on roles(:all) do |server|
51
+
52
+ packages = server.roles.map { |role| fetch(:"ubuntu_packages_for_#{role}",[])}.flatten + fetch(:ubuntu_packages) + default_ubuntu_packages
53
+ packages.uniq!
47
54
 
48
55
  sudo "apt-get", "-q", "-y", "update"
49
56
  sudo "apt-get", "-q", "-y", "--force-yes","install", *packages.flatten
@@ -79,9 +86,9 @@ Unattended-Upgrade::Allowed-Origins {
79
86
  end
80
87
 
81
88
 
82
- before "deploy:starting", "ubuntu:update_sources"
83
- after "ubuntu:update_sources", "ubuntu:install_packages"
84
- after "ubuntu:install_packages", "ubuntu:unattended_upgrades"
85
89
 
90
+ before "ubuntu:install_packages", "ubuntu:update_sources"
91
+ after "ubuntu:install_packages", "ubuntu:unattended_upgrades"
92
+ before "deploy:starting", "ubuntu:install_packages"
86
93
 
87
94
 
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Ubuntu
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-ubuntu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vlad Verestiuc