caterer 1.2.0 → 1.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b3147ba0fe11638b59e9868a8d4acd806f26c77
4
- data.tar.gz: 976a1d58307350bfb790500a54b118fbf88b4388
3
+ metadata.gz: e4c798c2f1c36ac80248f74196055b373f632dde
4
+ data.tar.gz: e7ef1a46ef4ae5accb35c636476a188d183c8dc6
5
5
  SHA512:
6
- metadata.gz: f5aa87a973e936714fe87065ee3ac861c3ceeb0f7de726b00bf2b9f5989c57ebef776fb31989352c99551710d536d3ee81aec5820410b4f3fb65f7203c5a3294
7
- data.tar.gz: 04c695725ef3e98cb235f974a7c2be6e80107690e6ba65c9a6fcb4fce96b9a929254053543a311a71dc31deda9ad0c47bb81f6d7a3400040af57f942cba434f8
6
+ metadata.gz: 4bb9ab8f4145b042315d78f3105c98215e22ccc00e50ad74220924f4e8f72a04c2580fadb3629fa6d137ab0b3d4977e2b7820f7a0002f0b03365f7c43ea5f403
7
+ data.tar.gz: 2b0ef6ca34b0d2380686edba5e69f012575dfffa56aaa96043426e866e6a9a21b6caa666bad471c9ed278157f995df3fb7834a63ab3c736d1f4f3387910e7d79
@@ -71,7 +71,8 @@ module Caterer
71
71
 
72
72
  res = server.ssh.sudo bash(File.read(installer)), :stream => true
73
73
 
74
- # somewhere mark (on the server) that we installed chef-solo for later uninstall
74
+ # mark (on the server) that we installed chef-solo for later uninstall
75
+ server.ssh.sudo "touch #{dest_var_dir}/INSTALL"
75
76
 
76
77
  unless res == 0
77
78
  server.ui.error "install failed with exit code: #{res}"
@@ -83,6 +84,29 @@ module Caterer
83
84
  res == 0 ? true : false
84
85
  end
85
86
 
87
+ def uninstall(server)
88
+ server.ui.info "Uninstalling..."
89
+
90
+ # figure out how to uninstall chef_solo IF we installed it
91
+ installed = server.ssh.sudo "[[ -f #{dest_var_dir}/INSTALL ]]"
92
+
93
+ if installed == 0
94
+ uninstaller = uninstall_script(server.platform)
95
+
96
+ if not File.exists? uninstaller
97
+ server.ui.error "#{server.platform} doesn't have an uninstall script"
98
+ return
99
+ end
100
+
101
+ res = server.ssh.sudo bash(File.read(uninstaller)), :stream => true
102
+
103
+ unless res == 0
104
+ server.ui.error "install failed with exit code: #{res}"
105
+ end
106
+ end
107
+
108
+ end
109
+
86
110
  def prepare(server)
87
111
  # create lib dir
88
112
  server.ssh.sudo "mkdir -p #{dest_lib_dir}", :stream => true
@@ -144,12 +168,6 @@ module Caterer
144
168
  "chef-solo -c #{target_solo_path} -j #{target_json_config_path}"
145
169
  end
146
170
 
147
- def uninstall(server)
148
- server.ui.info "Uninstalling..."
149
-
150
- # figure out how to uninstall chef_solo IF we installed it
151
- end
152
-
153
171
  protected
154
172
 
155
173
  def config
@@ -204,6 +222,10 @@ module Caterer
204
222
  File.expand_path("../../../templates/provisioner/chef_solo/install/#{platform}.sh", __FILE__)
205
223
  end
206
224
 
225
+ def uninstall_script(platform)
226
+ File.expand_path("../../../templates/provisioner/chef_solo/uninstall/#{platform}.sh", __FILE__)
227
+ end
228
+
207
229
  def solo_content(server)
208
230
  Tilt.new(File.expand_path('../../../templates/provisioner/chef_solo/solo.erb', __FILE__)).render(self, {:server => server})
209
231
  end
@@ -1,3 +1,3 @@
1
1
  module Caterer
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
@@ -0,0 +1,2 @@
1
+ # purge the omnibus installer
2
+ dpkg -P chef
@@ -0,0 +1,2 @@
1
+ # remove the omnibus installer
2
+ rpm -ev --nodeps chef
@@ -0,0 +1,2 @@
1
+ # remove the omnibus installer
2
+ rpm -ev --nodeps chef
@@ -0,0 +1,2 @@
1
+ # remove the omnibus installer
2
+ rpm -ev --nodeps chef
@@ -0,0 +1,5 @@
1
+ # remove fat-client
2
+ [[ -d /opt/chef ]] && rm -rf /opt/chef
3
+
4
+ # drop symlink
5
+ [[ -f /opt/local/bin/chef-solo ]] && rm -f /opt/local/bin/chef-solo
@@ -0,0 +1,2 @@
1
+ # remove the omnibus installer
2
+ rpm -ev --nodeps chef
@@ -0,0 +1,2 @@
1
+ # purge the omnibus installer
2
+ dpkg -P chef
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caterer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Flint
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-05 00:00:00.000000000 Z
11
+ date: 2013-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: log4r
@@ -236,6 +236,13 @@ files:
236
236
  - lib/templates/provisioner/chef_solo/install/suse.sh
237
237
  - lib/templates/provisioner/chef_solo/install/ubuntu.sh
238
238
  - lib/templates/provisioner/chef_solo/solo.erb
239
+ - lib/templates/provisioner/chef_solo/uninstall/debian.sh
240
+ - lib/templates/provisioner/chef_solo/uninstall/el.sh
241
+ - lib/templates/provisioner/chef_solo/uninstall/fedora.sh
242
+ - lib/templates/provisioner/chef_solo/uninstall/sles.sh
243
+ - lib/templates/provisioner/chef_solo/uninstall/smartos.sh
244
+ - lib/templates/provisioner/chef_solo/uninstall/suse.sh
245
+ - lib/templates/provisioner/chef_solo/uninstall/ubuntu.sh
239
246
  - lib/templates/provisioner/shell/script.erb
240
247
  - lib/templates/server/platform.sh
241
248
  homepage: ''