toque 1.3.0 → 1.4.0

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: f761384eb96137f039fca62a1392d589c551e24b
4
- data.tar.gz: a1fdae68c2bac72044d822a0efa92ecf8b187529
3
+ metadata.gz: d8c361fa7700cd4c77e837ec39883387620295eb
4
+ data.tar.gz: e233b14828e321676ec9c1ed46abf52ad45c3a5c
5
5
  SHA512:
6
- metadata.gz: e8b70c8223223cc0e57d6eb28ce4b8258f7d31911212555c657fe25aa926ae3fc09571f5219baf669dadcc50be1021aa2d480161fd128161939f6465f1efc5f7
7
- data.tar.gz: d183c37658c21a9271305fa9880618f97a550d03ecbde72d11234f5ecbb7a9edbfc6b46e8eb3d863370b000d2860dc611f9d7961270b3a347c4014ff84dc8aac
6
+ metadata.gz: 7dc8ce01d37c3668901bcbe13a1a0fb612ac43018a48d4f10f112d29d307f6bf38253b5911d65f14440b49efeacfce91fd542fac89fc17cadfcefdb80dbaaea4
7
+ data.tar.gz: 0774dbe0fb9c3dad72d75e63ea950122ba1b87b358c4fdb1b31be8cabd5a6679f0165f595dc76f1bb338b5e78a7c1535b097afab82bff76eaea9bb949eee7f56
data/README.md CHANGED
@@ -30,8 +30,9 @@ installed on first `run_list` call. **Toque** uses chef omnibus installer to
30
30
  install a complete self-contained embedded chef environment.
31
31
 
32
32
  You can specify a specific chef version by setting `:chef_version` to
33
- something different to `:latest` or `nil`. An already installed version of
34
- chef will not be upgraded.
33
+ something different to `nil`. If an already install with a different version
34
+ exists **toque** will run omnibus installer with specified version to
35
+ override installed chef.
35
36
 
36
37
  See `cap toque:config` for more options.
37
38
 
data/lib/toque/chef.rb CHANGED
@@ -15,7 +15,7 @@ module Toque
15
15
  set_default :chef_omnibus_installer_url, 'http://www.opscode.com/chef/install.sh'
16
16
  set_default :cookbooks_paths, %w(config/cookbooks vendor/cookbooks)
17
17
  set_default :databags_path, 'config/databags'
18
- set_default :chef_version, :latest
18
+ set_default :chef_version, '10.24.0'
19
19
  set_default :chef_debug, false
20
20
  set_default :chef_solo, '/opt/chef/bin/chef-solo'
21
21
 
@@ -65,10 +65,16 @@ module Toque
65
65
  #
66
66
  def install_command
67
67
  cmd = "#{top.sudo} bash"
68
- cmd += " -s -- -v #{fetch :chef_version}" unless fetch(:chef_version) == :latest or fetch(:chef_version).nil?
68
+ cmd += " -s -- -v #{required_version}" unless required_version.nil?
69
69
  cmd
70
70
  end
71
71
 
72
+ # Return required chef version.
73
+ #
74
+ def required_version
75
+ fetch(:chef_version) || nil
76
+ end
77
+
72
78
  #
73
79
  # Tasks
74
80
  #
@@ -76,6 +82,7 @@ module Toque
76
82
  desc 'Install chef via omnibus installed if not preset.'
77
83
  task :check do
78
84
  install unless installed?
85
+ install unless installed_version != required_version && !required_version.nil?
79
86
  end
80
87
 
81
88
  desc 'Installs chef using omnibus installer.'
data/lib/toque/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Toque
2
2
  module VERSION
3
3
  MAJOR = 1
4
- MINOR = 3
4
+ MINOR = 4
5
5
  PATCH = 0
6
6
  STAGE = nil
7
7
 
@@ -130,7 +130,7 @@ describe Toque::Chef, 'loaded into capistrano' do
130
130
 
131
131
  it 'should install chef using omnibus installer' do
132
132
  @configuration.toque.chef.install
133
- expect(@configuration).to have_run("sudo -p 'sudo password: ' true && curl -L http://www.opscode.com/chef/install.sh | sudo -p 'sudo password: ' bash")
133
+ expect(@configuration).to have_run("sudo -p 'sudo password: ' true && curl -L http://www.opscode.com/chef/install.sh | sudo -p 'sudo password: ' bash -s -- -v 10.24.0")
134
134
  end
135
135
 
136
136
  context 'with custom installer URL' do
@@ -138,7 +138,7 @@ describe Toque::Chef, 'loaded into capistrano' do
138
138
 
139
139
  it 'should install chef using custom omnibus installer' do
140
140
  @configuration.toque.chef.install
141
- expect(@configuration).to have_run("sudo -p 'sudo password: ' true && curl -L http://mysrv.tld/inst.sh | sudo -p 'sudo password: ' bash")
141
+ expect(@configuration).to have_run("sudo -p 'sudo password: ' true && curl -L http://mysrv.tld/inst.sh | sudo -p 'sudo password: ' bash -s -- -v 10.24.0")
142
142
  end
143
143
  end
144
144
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toque
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Graichen