tvdinner 0.0.2
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.
- data/LICENSE +201 -0
- data/NOTICE +1 -0
- data/README.md +0 -0
- data/VERSION +1 -0
- data/bin/chef-local +29 -0
- data/lib/chef/application/local.rb +172 -0
- data/lib/tvdinner/noop.rb +210 -0
- data/lib/tvdinner/version.rb +3 -0
- data/lib/tvdinner.rb +31 -0
- metadata +72 -0
data/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
data/NOTICE
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Includes code from Opscode Chef: chef-solo, chef/application/solo.rb
|
data/README.md
ADDED
|
File without changes
|
data/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.0.2
|
data/bin/chef-local
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
#
|
|
3
|
+
# Forked from:
|
|
4
|
+
# ./chef-solo - Run the chef client, in stand-alone mode
|
|
5
|
+
#
|
|
6
|
+
# Author:: AJ Christensen (<aj@opscode.com>)
|
|
7
|
+
# Copyright:: Copyright (c) 2008 Opscode, Inc.
|
|
8
|
+
# License:: Apache License, Version 2.0
|
|
9
|
+
#
|
|
10
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
11
|
+
# you may not use this file except in compliance with the License.
|
|
12
|
+
# You may obtain a copy of the License at
|
|
13
|
+
#
|
|
14
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
#
|
|
16
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
17
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
+
# See the License for the specific language governing permissions and
|
|
20
|
+
# limitations under the License.
|
|
21
|
+
#
|
|
22
|
+
# This is chef-local, a chef-solo designed to run in the current working area
|
|
23
|
+
# with comparison tools.
|
|
24
|
+
|
|
25
|
+
require 'rubygems'
|
|
26
|
+
$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
|
|
27
|
+
require 'chef/application/local'
|
|
28
|
+
|
|
29
|
+
Chef::Application::Local.new.run
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Author:: AJ Christensen (<aj@opscode.com>)
|
|
3
|
+
# Author:: Mark Mzyk (mmzyk@opscode.com)
|
|
4
|
+
# Copyright:: Copyright (c) 2008 Opscode, Inc.
|
|
5
|
+
# License:: Apache License, Version 2.0
|
|
6
|
+
#
|
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
# you may not use this file except in compliance with the License.
|
|
9
|
+
# You may obtain a copy of the License at
|
|
10
|
+
#
|
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
#
|
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
# See the License for the specific language governing permissions and
|
|
17
|
+
# limitations under the License.
|
|
18
|
+
|
|
19
|
+
require 'chef'
|
|
20
|
+
require 'chef/application'
|
|
21
|
+
require 'chef/client'
|
|
22
|
+
require 'chef/config'
|
|
23
|
+
require 'chef/daemon'
|
|
24
|
+
require 'chef/log'
|
|
25
|
+
require 'chef/rest'
|
|
26
|
+
require 'open-uri'
|
|
27
|
+
require 'fileutils'
|
|
28
|
+
|
|
29
|
+
class Chef::Application::Local < Chef::Application
|
|
30
|
+
|
|
31
|
+
option :config_file,
|
|
32
|
+
:short => "-c CONFIG",
|
|
33
|
+
:long => "--config CONFIG",
|
|
34
|
+
:default => Chef::Config.platform_specfic_path('/etc/chef/solo.rb'),
|
|
35
|
+
:description => "The configuration file to use"
|
|
36
|
+
|
|
37
|
+
option :formatter,
|
|
38
|
+
:short => "-F FORMATTER",
|
|
39
|
+
:long => "--format FORMATTER",
|
|
40
|
+
:description => "output format to use"
|
|
41
|
+
|
|
42
|
+
option :color,
|
|
43
|
+
:long => '--[no-]color',
|
|
44
|
+
:boolean => true,
|
|
45
|
+
:default => false,
|
|
46
|
+
:description => "Use colored output, defaults to disabled"
|
|
47
|
+
|
|
48
|
+
option :log_level,
|
|
49
|
+
:short => "-l LEVEL",
|
|
50
|
+
:long => "--log_level LEVEL",
|
|
51
|
+
:description => "Set the log level (debug, info, warn, error, fatal)",
|
|
52
|
+
:proc => lambda { |l| l.to_sym }
|
|
53
|
+
|
|
54
|
+
option :log_location,
|
|
55
|
+
:short => "-L LOGLOCATION",
|
|
56
|
+
:long => "--logfile LOGLOCATION",
|
|
57
|
+
:description => "Set the log file location, defaults to STDOUT",
|
|
58
|
+
:proc => nil
|
|
59
|
+
|
|
60
|
+
option :help,
|
|
61
|
+
:short => "-h",
|
|
62
|
+
:long => "--help",
|
|
63
|
+
:description => "Show this message",
|
|
64
|
+
:on => :tail,
|
|
65
|
+
:boolean => true,
|
|
66
|
+
:show_options => true,
|
|
67
|
+
:exit => 0
|
|
68
|
+
|
|
69
|
+
option :json_attribs,
|
|
70
|
+
:short => "-j JSON_ATTRIBS",
|
|
71
|
+
:long => "--json-attributes JSON_ATTRIBS",
|
|
72
|
+
:description => "Load attributes from a JSON file or URL",
|
|
73
|
+
:proc => nil
|
|
74
|
+
|
|
75
|
+
option :node_name,
|
|
76
|
+
:short => "-N NODE_NAME",
|
|
77
|
+
:long => "--node-name NODE_NAME",
|
|
78
|
+
:description => "The node name for this client",
|
|
79
|
+
:proc => nil
|
|
80
|
+
|
|
81
|
+
option :version,
|
|
82
|
+
:short => "-v",
|
|
83
|
+
:long => "--version",
|
|
84
|
+
:description => "Show chef version",
|
|
85
|
+
:boolean => true,
|
|
86
|
+
:proc => lambda {|v| puts "Chef: #{::Chef::VERSION}"},
|
|
87
|
+
:exit => 0
|
|
88
|
+
|
|
89
|
+
option :override_runlist,
|
|
90
|
+
:short => "-o RunlistItem,RunlistItem...",
|
|
91
|
+
:long => "--override-runlist RunlistItem,RunlistItem...",
|
|
92
|
+
:description => "Replace current run list with specified items",
|
|
93
|
+
:proc => lambda{|items|
|
|
94
|
+
items = items.split(',')
|
|
95
|
+
items.compact.map{|item|
|
|
96
|
+
Chef::RunList::RunListItem.new(item)
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
option :why_run,
|
|
101
|
+
:short => '-W',
|
|
102
|
+
:long => '--why-run',
|
|
103
|
+
:description => 'Enable whyrun mode',
|
|
104
|
+
:boolean => true
|
|
105
|
+
|
|
106
|
+
option :noop,
|
|
107
|
+
:short => '-N',
|
|
108
|
+
:long => '--noop',
|
|
109
|
+
:description => 'Enable noop mode',
|
|
110
|
+
:boolean => true
|
|
111
|
+
|
|
112
|
+
attr_reader :chef_solo_json
|
|
113
|
+
|
|
114
|
+
def initialize
|
|
115
|
+
super
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
def reconfigure
|
|
119
|
+
super
|
|
120
|
+
|
|
121
|
+
Chef::Config[:solo] = true
|
|
122
|
+
|
|
123
|
+
if Chef::Config[:noop]
|
|
124
|
+
require 'tvdinner/noop'
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if Chef::Config[:json_attribs]
|
|
128
|
+
begin
|
|
129
|
+
json_io = case Chef::Config[:json_attribs]
|
|
130
|
+
when /^(http|https):\/\//
|
|
131
|
+
@rest = Chef::REST.new(Chef::Config[:json_attribs], nil, nil)
|
|
132
|
+
@rest.get_rest(Chef::Config[:json_attribs], true).open
|
|
133
|
+
else
|
|
134
|
+
open(Chef::Config[:json_attribs])
|
|
135
|
+
end
|
|
136
|
+
rescue SocketError => error
|
|
137
|
+
Chef::Application.fatal!("I cannot connect to #{Chef::Config[:json_attribs]}", 2)
|
|
138
|
+
rescue Errno::ENOENT => error
|
|
139
|
+
Chef::Application.fatal!("I cannot find #{Chef::Config[:json_attribs]}", 2)
|
|
140
|
+
rescue Errno::EACCES => error
|
|
141
|
+
Chef::Application.fatal!("Permissions are incorrect on #{Chef::Config[:json_attribs]}. Please chmod a+r #{Chef::Config[:json_attribs]}", 2)
|
|
142
|
+
rescue Exception => error
|
|
143
|
+
Chef::Application.fatal!("Got an unexpected error reading #{Chef::Config[:json_attribs]}: #{error.message}", 2)
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
begin
|
|
147
|
+
@chef_client_json = Chef::JSONCompat.from_json(json_io.read)
|
|
148
|
+
json_io.close unless json_io.closed?
|
|
149
|
+
rescue JSON::ParserError => error
|
|
150
|
+
Chef::Application.fatal!("Could not parse the provided JSON file (#{Chef::Config[:json_attribs]})!: " + error.message, 2)
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
def setup_application
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
def run_application
|
|
159
|
+
loop do
|
|
160
|
+
begin
|
|
161
|
+
run_chef_client
|
|
162
|
+
Chef::Application.exit! "Exiting", 0
|
|
163
|
+
rescue SystemExit => e
|
|
164
|
+
raise
|
|
165
|
+
rescue Exception => e
|
|
166
|
+
Chef::Application.debug_stacktrace(e)
|
|
167
|
+
Chef::Application.fatal!("#{e.class}: #{e.message}", 1)
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
end
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
class Chef
|
|
2
|
+
module Mixin # Checksum
|
|
3
|
+
module Checksum
|
|
4
|
+
def checksum(file)
|
|
5
|
+
return "f" * 64
|
|
6
|
+
end
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
class Provider # Macports
|
|
10
|
+
class Package
|
|
11
|
+
class Macports < Chef::Provider::Package
|
|
12
|
+
def install_package(name, version)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def purge_package(name, version)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def remove_package(name, version)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def upgrade_package(name, version)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
private
|
|
25
|
+
|
|
26
|
+
def current_installed_version
|
|
27
|
+
"1.2.3"
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def macports_candidate_version
|
|
31
|
+
"1.2.3"
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
class Provider # Directory
|
|
37
|
+
class Directory < Chef::Provider::File
|
|
38
|
+
def define_resource_requirements
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def action_create
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def action_delete
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
class Provider # Execute
|
|
49
|
+
class Execute < Chef::Provider
|
|
50
|
+
def action_run
|
|
51
|
+
true
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
class Provider # Template
|
|
56
|
+
class Template < Chef::Provider::File
|
|
57
|
+
def action_create
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
class Provider # File
|
|
62
|
+
class File < Chef::Provider
|
|
63
|
+
def diff_current(temp_path)
|
|
64
|
+
[ "(no diff)" ]
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def define_resource_requirements
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def action_create
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def action_delete
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def action_touch
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
class Provider # CookbookFile
|
|
81
|
+
class CookbookFile < Chef::Provider::File
|
|
82
|
+
def action_create
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
class Provider # Dscl Group
|
|
87
|
+
class Group
|
|
88
|
+
class Dscl < Chef::Provider::Group
|
|
89
|
+
def create_group
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def manage_group
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def remove_group
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
class Provider # Dscl User
|
|
101
|
+
class User
|
|
102
|
+
class Dscl < Chef::Provider::User
|
|
103
|
+
def create_user
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
def manage_user
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
def remove_user
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
def lock_user
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def unlock_user
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
class Provider # Script
|
|
121
|
+
class Script < Chef::Provider::Execute
|
|
122
|
+
def set_owner_and_group
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
class Provider # Service
|
|
127
|
+
class Service < Chef::Provider
|
|
128
|
+
def run_action (action=nil)
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
def action_enable
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
def action_disable
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
def action_start
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def action_stop
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
def action_restart
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
def action_reload
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
class Provider # Rubygems
|
|
151
|
+
class Package
|
|
152
|
+
class Rubygems < Chef::Provider::Package
|
|
153
|
+
def install_package(name, version)
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
def upgrade_package(name, version)
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
def remove_package(name, version)
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
def purge_package(name, version)
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
class Provider # Cron
|
|
168
|
+
class Cron < Chef::Provider
|
|
169
|
+
def cron_different?
|
|
170
|
+
false
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
def action_create
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
def action_delete
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
class Provider # Link
|
|
181
|
+
class Link < Chef::Provider
|
|
182
|
+
def action_create
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
def action_delete
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
end
|
|
189
|
+
class Provider # RemoteFile
|
|
190
|
+
class RemoteFile < Chef::Provider::File
|
|
191
|
+
def action_create
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
def current_resource_matches_target_checksum?
|
|
195
|
+
true
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
def matches_current_checksum?(candidate_file)
|
|
199
|
+
true
|
|
200
|
+
end
|
|
201
|
+
end
|
|
202
|
+
end
|
|
203
|
+
class Provider # Deploy
|
|
204
|
+
class Deploy < Chef::Provider
|
|
205
|
+
def action_deploy; end
|
|
206
|
+
def action_force_deploy; end
|
|
207
|
+
def action_rollback; end
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
end
|
data/lib/tvdinner.rb
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
module TVDinner
|
|
2
|
+
end
|
|
3
|
+
|
|
4
|
+
class Chef
|
|
5
|
+
class Config
|
|
6
|
+
def self.local_config shome
|
|
7
|
+
sandbox_path platform_specific_path("#{shome}/var/chef/sandboxes")
|
|
8
|
+
checksum_path platform_specific_path("#{shome}/var/chef/checksums")
|
|
9
|
+
file_cache_path platform_specific_path("#{shome}/var/chef/cache")
|
|
10
|
+
file_backup_path platform_specific_path("#{shome}/var/chef/backup")
|
|
11
|
+
node_path platform_specific_path("#{shome}/var/chef/node")
|
|
12
|
+
role_path platform_specific_path("#{shome}/var/chef/roles")
|
|
13
|
+
data_bag_path platform_specific_path("#{shome}/var/chef/data_bags")
|
|
14
|
+
client_key platform_specific_path("#{shome}/etc/chef/client.pem")
|
|
15
|
+
validation_key platform_specific_path("#{shome}/etc/chef/validation.pem")
|
|
16
|
+
signing_ca_cert platform_specific_path("#{shome}/var/chef/ca/cert.pem")
|
|
17
|
+
signing_ca_key platform_specific_path("#{shome}/var/chef/ca/key.pem")
|
|
18
|
+
cache_options({ :path => platform_specific_path("#{shome}/var/chef/cache/checksums") })
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def self.bundler_config more_paths=[]
|
|
22
|
+
# look in bundler gems for cookbooks, which are peers to lib/
|
|
23
|
+
# for every gem/xxx/lib, look for gem/xxx/cookbooks
|
|
24
|
+
bundler_paths = $:.collect do |x|
|
|
25
|
+
File.join(File.expand_path("..", x), "cookbooks")
|
|
26
|
+
end.select {|x| File.directory? x } # return existing directories
|
|
27
|
+
|
|
28
|
+
cookbook_path Array(more_paths).concat(bundler_paths)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: tvdinner
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.2
|
|
5
|
+
prerelease:
|
|
6
|
+
platform: ruby
|
|
7
|
+
authors:
|
|
8
|
+
- Tom Bombadil
|
|
9
|
+
autorequire:
|
|
10
|
+
bindir: bin
|
|
11
|
+
cert_chain: []
|
|
12
|
+
date: 2013-05-31 00:00:00.000000000 Z
|
|
13
|
+
dependencies:
|
|
14
|
+
- !ruby/object:Gem::Dependency
|
|
15
|
+
name: tvdinner
|
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
|
17
|
+
none: false
|
|
18
|
+
requirements:
|
|
19
|
+
- - ! '>='
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: '0'
|
|
22
|
+
type: :runtime
|
|
23
|
+
prerelease: false
|
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
+
none: false
|
|
26
|
+
requirements:
|
|
27
|
+
- - ! '>='
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
version: '0'
|
|
30
|
+
description: Spork utility, cookbooks for cookbook gems scaffolding, helper functions
|
|
31
|
+
for chef-solo, compare modes
|
|
32
|
+
email: amanibhavam@destructuring.org
|
|
33
|
+
executables:
|
|
34
|
+
- chef-local
|
|
35
|
+
extensions: []
|
|
36
|
+
extra_rdoc_files: []
|
|
37
|
+
files:
|
|
38
|
+
- lib/chef/application/local.rb
|
|
39
|
+
- lib/tvdinner.rb
|
|
40
|
+
- lib/tvdinner/noop.rb
|
|
41
|
+
- lib/tvdinner/version.rb
|
|
42
|
+
- bin/chef-local
|
|
43
|
+
- LICENSE
|
|
44
|
+
- NOTICE
|
|
45
|
+
- VERSION
|
|
46
|
+
- README.md
|
|
47
|
+
homepage: http://destructuring.org/tvdinner
|
|
48
|
+
licenses:
|
|
49
|
+
- Apache 2.0
|
|
50
|
+
post_install_message:
|
|
51
|
+
rdoc_options: []
|
|
52
|
+
require_paths:
|
|
53
|
+
- lib
|
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
55
|
+
none: false
|
|
56
|
+
requirements:
|
|
57
|
+
- - ! '>='
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: '0'
|
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
|
+
none: false
|
|
62
|
+
requirements:
|
|
63
|
+
- - ! '>='
|
|
64
|
+
- !ruby/object:Gem::Version
|
|
65
|
+
version: '0'
|
|
66
|
+
requirements: []
|
|
67
|
+
rubyforge_project:
|
|
68
|
+
rubygems_version: 1.8.25
|
|
69
|
+
signing_key:
|
|
70
|
+
specification_version: 3
|
|
71
|
+
summary: support for chef cookbooks as rubygems
|
|
72
|
+
test_files: []
|