chef 0.8.16 → 0.9.0.a3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of chef might be problematic. Click here for more details.

Files changed (185) hide show
  1. data/bin/shef +1 -0
  2. data/distro/common/man/man1/chef-server-webui.1 +106 -0
  3. data/distro/common/man/man1/chef-server.1 +0 -1
  4. data/distro/common/man/man1/chef-solr-indexer.1 +55 -0
  5. data/distro/common/man/man1/chef-solr.1 +55 -0
  6. data/distro/common/man/man8/chef-client.8 +4 -2
  7. data/distro/common/man/man8/chef-solo.8 +1 -2
  8. data/distro/common/man/man8/chef-solr-rebuild.8 +37 -0
  9. data/distro/common/man/man8/knife.8 +668 -266
  10. data/distro/common/man/man8/shef.8 +45 -0
  11. data/distro/common/markdown/README +3 -0
  12. data/distro/common/markdown/knife.mkd +520 -0
  13. data/distro/debian/etc/default/chef-client +4 -0
  14. data/distro/debian/etc/default/chef-server +6 -0
  15. data/distro/debian/etc/default/chef-server-webui +6 -0
  16. data/distro/debian/etc/default/chef-solr +4 -0
  17. data/distro/debian/etc/default/chef-solr-indexer +4 -0
  18. data/distro/debian/etc/init.d/chef-client +41 -41
  19. data/distro/debian/etc/init.d/chef-server +10 -10
  20. data/distro/debian/etc/init.d/chef-server-webui +121 -0
  21. data/distro/debian/etc/init.d/chef-solr +177 -0
  22. data/distro/debian/etc/init.d/chef-solr-indexer +176 -0
  23. data/distro/redhat/etc/init.d/chef-client +76 -48
  24. data/distro/redhat/etc/init.d/chef-server +85 -51
  25. data/distro/redhat/etc/init.d/chef-server-webui +85 -51
  26. data/distro/redhat/etc/init.d/chef-solr +77 -49
  27. data/distro/redhat/etc/init.d/chef-solr-indexer +77 -48
  28. data/distro/redhat/etc/logrotate.d/chef-client +8 -0
  29. data/distro/redhat/etc/logrotate.d/chef-server +8 -0
  30. data/distro/redhat/etc/logrotate.d/chef-server-webui +8 -0
  31. data/distro/redhat/etc/logrotate.d/chef-solr +8 -0
  32. data/distro/redhat/etc/logrotate.d/chef-solr-indexer +8 -0
  33. data/distro/redhat/etc/sysconfig/chef-client +9 -4
  34. data/distro/redhat/etc/sysconfig/chef-server +10 -6
  35. data/distro/redhat/etc/sysconfig/chef-server-webui +10 -6
  36. data/distro/redhat/etc/sysconfig/chef-solr +3 -4
  37. data/distro/redhat/etc/sysconfig/chef-solr-indexer +3 -3
  38. data/lib/chef.rb +16 -5
  39. data/lib/chef/application/knife.rb +2 -2
  40. data/lib/chef/application/solo.rb +1 -7
  41. data/lib/chef/cache/checksum.rb +12 -5
  42. data/lib/chef/cache/file_cache_by_checksum.rb +52 -0
  43. data/lib/chef/checksum.rb +115 -0
  44. data/lib/chef/client.rb +193 -185
  45. data/lib/chef/config.rb +9 -1
  46. data/lib/chef/cookbook/cookbook_collection.rb +43 -0
  47. data/lib/chef/cookbook/file_system_file_vendor.rb +53 -0
  48. data/lib/chef/cookbook/file_vendor.rb +47 -0
  49. data/lib/chef/cookbook/metadata.rb +34 -35
  50. data/lib/chef/cookbook/metadata/version.rb +1 -1
  51. data/lib/chef/cookbook_loader.rb +70 -45
  52. data/lib/chef/cookbook_version.rb +760 -0
  53. data/lib/chef/couchdb.rb +8 -5
  54. data/lib/chef/data_bag_item.rb +5 -5
  55. data/lib/chef/exceptions.rb +10 -0
  56. data/lib/chef/file_access_control.rb +134 -0
  57. data/lib/chef/handler.rb +62 -0
  58. data/lib/chef/handler/json_file.rb +47 -0
  59. data/lib/chef/knife.rb +14 -2
  60. data/lib/chef/knife/bootstrap.rb +126 -0
  61. data/lib/chef/knife/cookbook_bulk_delete.rb +1 -1
  62. data/lib/chef/knife/cookbook_delete.rb +4 -4
  63. data/lib/chef/knife/cookbook_download.rb +57 -26
  64. data/lib/chef/knife/cookbook_metadata.rb +2 -2
  65. data/lib/chef/knife/cookbook_show.rb +30 -11
  66. data/lib/chef/knife/cookbook_upload.rb +113 -86
  67. data/lib/chef/knife/ec2_server_create.rb +146 -0
  68. data/lib/chef/knife/ec2_server_delete.rb +84 -0
  69. data/lib/chef/knife/ec2_server_list.rb +82 -0
  70. data/lib/chef/knife/status.rb +51 -0
  71. data/lib/chef/mixin/language_include_attribute.rb +16 -11
  72. data/lib/chef/mixin/language_include_recipe.rb +15 -16
  73. data/lib/chef/mixin/recipe_definition_dsl_core.rb +17 -20
  74. data/lib/chef/mixin/shell_out.rb +38 -0
  75. data/lib/chef/mixins.rb +1 -1
  76. data/lib/chef/node.rb +190 -63
  77. data/lib/chef/node/attribute.rb +92 -78
  78. data/lib/chef/platform.rb +24 -4
  79. data/lib/chef/provider.rb +28 -10
  80. data/lib/chef/provider/breakpoint.rb +2 -2
  81. data/lib/chef/provider/cookbook_file.rb +96 -0
  82. data/lib/chef/provider/cron.rb +2 -2
  83. data/lib/chef/provider/deploy.rb +12 -10
  84. data/lib/chef/provider/env.rb +152 -0
  85. data/lib/chef/provider/env/windows.rb +75 -0
  86. data/lib/chef/provider/file.rb +10 -14
  87. data/lib/chef/provider/group.rb +15 -2
  88. data/lib/chef/provider/group/dscl.rb +17 -25
  89. data/lib/chef/provider/group/gpasswd.rb +6 -3
  90. data/lib/chef/provider/group/pw.rb +3 -7
  91. data/lib/chef/provider/group/windows.rb +79 -0
  92. data/lib/chef/provider/link.rb +4 -5
  93. data/lib/chef/provider/mdadm.rb +25 -18
  94. data/lib/chef/provider/mount/mount.rb +28 -27
  95. data/lib/chef/provider/package.rb +35 -35
  96. data/lib/chef/provider/package/dpkg.rb +13 -10
  97. data/lib/chef/provider/package/easy_install.rb +6 -6
  98. data/lib/chef/provider/package/freebsd.rb +17 -51
  99. data/lib/chef/provider/package/rpm.rb +1 -1
  100. data/lib/chef/provider/package/rubygems.rb +391 -74
  101. data/lib/chef/provider/package/yum.rb +2 -2
  102. data/lib/chef/provider/package/zypper.rb +2 -1
  103. data/lib/chef/provider/remote_directory.rb +60 -83
  104. data/lib/chef/provider/remote_file.rb +17 -66
  105. data/lib/chef/provider/script.rb +20 -9
  106. data/lib/chef/provider/service.rb +23 -30
  107. data/lib/chef/provider/service/arch.rb +3 -3
  108. data/lib/chef/provider/service/debian.rb +22 -17
  109. data/lib/chef/provider/service/freebsd.rb +4 -4
  110. data/lib/chef/provider/service/init.rb +2 -2
  111. data/lib/chef/provider/service/redhat.rb +14 -16
  112. data/lib/chef/provider/service/simple.rb +7 -3
  113. data/lib/chef/provider/service/solaris.rb +85 -0
  114. data/lib/chef/provider/service/upstart.rb +12 -7
  115. data/lib/chef/provider/service/windows.rb +2 -2
  116. data/lib/chef/provider/template.rb +133 -118
  117. data/lib/chef/provider/user.rb +34 -17
  118. data/lib/chef/provider/user/dscl.rb +117 -114
  119. data/lib/chef/provider/user/windows.rb +124 -0
  120. data/lib/chef/providers.rb +7 -0
  121. data/lib/chef/recipe.rb +39 -20
  122. data/lib/chef/resource.rb +47 -52
  123. data/lib/chef/resource/apt_package.rb +4 -4
  124. data/lib/chef/resource/bash.rb +4 -4
  125. data/lib/chef/resource/cookbook_file.rb +45 -0
  126. data/lib/chef/resource/cron.rb +3 -3
  127. data/lib/chef/resource/csh.rb +4 -4
  128. data/lib/chef/resource/deploy.rb +3 -3
  129. data/lib/chef/resource/directory.rb +4 -4
  130. data/lib/chef/resource/dpkg_package.rb +4 -4
  131. data/lib/chef/resource/easy_install_package.rb +3 -3
  132. data/lib/chef/resource/env.rb +58 -0
  133. data/lib/chef/resource/erl_call.rb +3 -3
  134. data/lib/chef/resource/execute.rb +3 -3
  135. data/lib/chef/resource/file.rb +3 -3
  136. data/lib/chef/resource/freebsd_package.rb +3 -3
  137. data/lib/chef/resource/gem_package.rb +17 -9
  138. data/lib/chef/resource/git.rb +3 -3
  139. data/lib/chef/resource/group.rb +3 -3
  140. data/lib/chef/resource/http_request.rb +4 -4
  141. data/lib/chef/resource/ifconfig.rb +3 -3
  142. data/lib/chef/resource/link.rb +3 -3
  143. data/lib/chef/resource/log.rb +2 -2
  144. data/lib/chef/resource/macports_package.rb +2 -2
  145. data/lib/chef/resource/mdadm.rb +3 -3
  146. data/lib/chef/resource/mount.rb +2 -2
  147. data/lib/chef/resource/package.rb +4 -4
  148. data/lib/chef/resource/pacman_package.rb +4 -4
  149. data/lib/chef/resource/perl.rb +4 -4
  150. data/lib/chef/resource/portage_package.rb +4 -4
  151. data/lib/chef/resource/python.rb +4 -4
  152. data/lib/chef/resource/remote_directory.rb +3 -3
  153. data/lib/chef/resource/remote_file.rb +26 -3
  154. data/lib/chef/resource/route.rb +3 -3
  155. data/lib/chef/resource/ruby.rb +3 -3
  156. data/lib/chef/resource/ruby_block.rb +3 -2
  157. data/lib/chef/resource/scm.rb +7 -5
  158. data/lib/chef/resource/script.rb +4 -4
  159. data/lib/chef/resource/service.rb +3 -3
  160. data/lib/chef/resource/subversion.rb +4 -2
  161. data/lib/chef/resource/template.rb +3 -3
  162. data/lib/chef/resource/user.rb +3 -3
  163. data/lib/chef/resource/yum_package.rb +3 -3
  164. data/lib/chef/resource_collection.rb +9 -5
  165. data/lib/chef/resources.rb +2 -0
  166. data/lib/chef/rest.rb +4 -0
  167. data/lib/chef/role.rb +2 -0
  168. data/lib/chef/run_context.rb +108 -0
  169. data/lib/chef/run_list.rb +75 -98
  170. data/lib/chef/run_list/run_list_expansion.rb +156 -0
  171. data/lib/chef/run_list/run_list_item.rb +71 -0
  172. data/lib/chef/runner.rb +58 -61
  173. data/lib/chef/sandbox.rb +147 -0
  174. data/lib/chef/shef.rb +4 -3
  175. data/lib/chef/shef/ext.rb +12 -4
  176. data/lib/chef/shef/shef_session.rb +27 -23
  177. data/lib/chef/shell_out.rb +375 -0
  178. data/lib/chef/util/windows.rb +56 -0
  179. data/lib/chef/util/windows/net_group.rb +101 -0
  180. data/lib/chef/util/windows/net_user.rb +198 -0
  181. data/lib/chef/version.rb +20 -0
  182. metadata +112 -22
  183. data/lib/chef/compile.rb +0 -158
  184. data/lib/chef/cookbook.rb +0 -201
  185. data/lib/chef/mixin/generate_url.rb +0 -58
@@ -0,0 +1,56 @@
1
+ #
2
+ # Author:: Doug MacEachern (<dougm@vmware.com>)
3
+ # Copyright:: Copyright (c) 2010 VMware, Inc.
4
+ # License:: Apache License, Version 2.0
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+ #requires: gem install windows-pr
19
+ require 'windows/api'
20
+ require 'windows/error'
21
+ require 'windows/handle'
22
+ require 'windows/unicode'
23
+ require 'windows/msvcrt/buffer'
24
+ require 'windows/msvcrt/string'
25
+ require 'windows/network/management'
26
+
27
+ class Chef
28
+ class Util
29
+ class Windows
30
+ protected
31
+
32
+ include ::Windows::Error
33
+ include ::Windows::Unicode
34
+ include ::Windows::MSVCRT::Buffer
35
+ include ::Windows::MSVCRT::String
36
+ include ::Windows::Network::Management
37
+
38
+ PTR_SIZE = 4 #XXX 64-bit
39
+
40
+ def lpwstr_to_s(buffer, offset)
41
+ str = 0.chr * (256 * 2) #XXX unhardcode this length (*2 for WCHAR)
42
+ wcscpy str, buffer[offset*PTR_SIZE,PTR_SIZE].unpack('L')[0]
43
+ wide_to_multi str
44
+ end
45
+
46
+ def dword_to_i(buffer, offset)
47
+ buffer[offset*PTR_SIZE,PTR_SIZE].unpack('i')[0] || 0
48
+ end
49
+
50
+ #return pointer for use with pack('L')
51
+ def str_to_ptr(v)
52
+ [v].pack('p*').unpack('L')[0]
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,101 @@
1
+ #
2
+ # Author:: Doug MacEachern (<dougm@vmware.com>)
3
+ # Copyright:: Copyright (c) 2010 VMware, Inc.
4
+ # License:: Apache License, Version 2.0
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ require 'chef/util/windows'
20
+
21
+ #wrapper around a subset of the NetGroup* APIs.
22
+ #nothing Chef specific, but not complete enough to be its own gem, so util for now.
23
+ class Chef::Util::Windows::NetGroup < Chef::Util::Windows
24
+
25
+ private
26
+
27
+ def pack_str(s)
28
+ [str_to_ptr(s)].pack('L')
29
+ end
30
+
31
+ def modify_members(members, func)
32
+ buffer = 0.chr * (members.size * PTR_SIZE)
33
+ members.each_with_index do |member,offset|
34
+ buffer[offset*PTR_SIZE,PTR_SIZE] = pack_str(multi_to_wide(member))
35
+ end
36
+ rc = func.call(nil, @name, 3, buffer, members.size)
37
+ if rc != NERR_Success
38
+ raise ArgumentError, get_last_error(rc)
39
+ end
40
+ end
41
+
42
+ public
43
+
44
+ def initialize(groupname)
45
+ @name = multi_to_wide(groupname)
46
+ end
47
+
48
+ def local_get_members
49
+ group_members = []
50
+ handle = 0.chr * PTR_SIZE
51
+ rc = ERROR_MORE_DATA
52
+
53
+ while rc == ERROR_MORE_DATA
54
+ ptr = 0.chr * PTR_SIZE
55
+ nread = 0.chr * PTR_SIZE
56
+ total = 0.chr * PTR_SIZE
57
+
58
+ rc = NetLocalGroupGetMembers.call(nil, @name, 1, ptr, -1,
59
+ nread, total, handle)
60
+ if (rc == NERR_Success) || (rc == ERROR_MORE_DATA)
61
+ ptr = ptr.unpack('L')[0]
62
+ nread = nread.unpack('i')[0]
63
+ members = 0.chr * (nread * (PTR_SIZE * 3)) #nread * sizeof(LOCALGROUP_MEMBERS_INFO_1)
64
+ memcpy(members, ptr, members.size)
65
+
66
+ #3 pointer fields in LOCALGROUP_MEMBERS_INFO_1, offset 2*PTR_SIZE is lgrmi1_name
67
+ nread.times do |i|
68
+ offset = (i * 3) + 2
69
+ member = lpwstr_to_s(members, offset)
70
+ group_members << member
71
+ end
72
+ NetApiBufferFree(ptr)
73
+ else
74
+ raise ArgumentError, get_last_error(rc)
75
+ end
76
+ end
77
+ group_members
78
+ end
79
+
80
+ def local_add
81
+ rc = NetLocalGroupAdd.call(nil, 0, pack_str(@name), nil)
82
+ if rc != NERR_Success
83
+ raise ArgumentError, get_last_error(rc)
84
+ end
85
+ end
86
+
87
+ def local_set_members(members)
88
+ modify_members(members, NetLocalGroupSetMembers)
89
+ end
90
+
91
+ def local_add_members(members)
92
+ modify_members(members, NetLocalGroupAddMembers)
93
+ end
94
+
95
+ def local_delete
96
+ rc = NetLocalGroupDel.call(nil, @name)
97
+ if rc != NERR_Success
98
+ raise ArgumentError, get_last_error(rc)
99
+ end
100
+ end
101
+ end
@@ -0,0 +1,198 @@
1
+ #
2
+ # Author:: Doug MacEachern (<dougm@vmware.com>)
3
+ # Copyright:: Copyright (c) 2010 VMware, Inc.
4
+ # License:: Apache License, Version 2.0
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ require 'chef/util/windows'
20
+
21
+ #wrapper around a subset of the NetUser* APIs.
22
+ #nothing Chef specific, but not complete enough to be its own gem, so util for now.
23
+ class Chef::Util::Windows::NetUser < Chef::Util::Windows
24
+
25
+ private
26
+
27
+ LogonUser = Windows::API.new('LogonUser', 'SSSLLP', 'I', 'advapi32')
28
+
29
+ DOMAIN_GROUP_RID_USERS = 0x00000201
30
+
31
+ UF_SCRIPT = 0x000001
32
+ UF_ACCOUNTDISABLE = 0x000002
33
+ UF_PASSWD_CANT_CHANGE = 0x000040
34
+ UF_NORMAL_ACCOUNT = 0x000200
35
+ UF_DONT_EXPIRE_PASSWD = 0x010000
36
+
37
+ #[:symbol_name, default_val]
38
+ #default_val duals as field type
39
+ #array index duals as structure offset
40
+ USER_INFO_3 = [
41
+ [:name, nil],
42
+ [:password, nil],
43
+ [:password_age, 0],
44
+ [:priv, 0], #"The NetUserAdd and NetUserSetInfo functions ignore this member"
45
+ [:home_dir, nil],
46
+ [:comment, nil],
47
+ [:flags, UF_SCRIPT|UF_DONT_EXPIRE_PASSWD|UF_NORMAL_ACCOUNT],
48
+ [:script_path, nil],
49
+ [:auth_flags, 0],
50
+ [:full_name, nil],
51
+ [:user_comment, nil],
52
+ [:parms, nil],
53
+ [:workstations, nil],
54
+ [:last_logon, 0],
55
+ [:last_logoff, 0],
56
+ [:acct_expires, -1],
57
+ [:max_storage, -1],
58
+ [:units_per_week, 0],
59
+ [:logon_hours, nil],
60
+ [:bad_pw_count, 0],
61
+ [:num_logons, 0],
62
+ [:logon_server, nil],
63
+ [:country_code, 0],
64
+ [:code_page, 0],
65
+ [:user_id, 0],
66
+ [:primary_group_id, DOMAIN_GROUP_RID_USERS],
67
+ [:profile, nil],
68
+ [:home_dir_drive, nil],
69
+ [:password_expired, 0]
70
+ ]
71
+
72
+ USER_INFO_3_TEMPLATE =
73
+ USER_INFO_3.collect { |field| field[1].class == Fixnum ? 'i' : 'L' }.join
74
+
75
+ SIZEOF_USER_INFO_3 = #sizeof(USER_INFO_3)
76
+ USER_INFO_3.inject(0){|sum,item|
77
+ sum + (item[1].class == Fixnum ? 4 : PTR_SIZE)
78
+ }
79
+
80
+ def user_info_3(args)
81
+ USER_INFO_3.collect { |field|
82
+ args.include?(field[0]) ? args[field[0]] : field[1]
83
+ }
84
+ end
85
+
86
+ def user_info_3_pack(user)
87
+ user.collect { |v|
88
+ v.class == Fixnum ? v : str_to_ptr(multi_to_wide(v))
89
+ }.pack(USER_INFO_3_TEMPLATE)
90
+ end
91
+
92
+ def user_info_3_unpack(buffer)
93
+ user = Hash.new
94
+ USER_INFO_3.each_with_index do |field,offset|
95
+ user[field[0]] = field[1].class == Fixnum ?
96
+ dword_to_i(buffer, offset) : lpwstr_to_s(buffer, offset)
97
+ end
98
+ user
99
+ end
100
+
101
+ def set_info(args)
102
+ user = user_info_3(args)
103
+ buffer = user_info_3_pack(user)
104
+ rc = NetUserSetInfo.call(nil, @name, 3, buffer, nil)
105
+ if rc != NERR_Success
106
+ raise ArgumentError, get_last_error(rc)
107
+ end
108
+ end
109
+
110
+ public
111
+
112
+ def initialize(username)
113
+ @username = username
114
+ @name = multi_to_wide(username)
115
+ end
116
+
117
+ LOGON32_PROVIDER_DEFAULT = 0
118
+ LOGON32_LOGON_NETWORK = 3
119
+ #XXX for an extra painful alternative, see: http://support.microsoft.com/kb/180548
120
+ def validate_credentials(passwd)
121
+ token = 0.chr * PTR_SIZE
122
+ res = LogonUser.call(@username, nil, passwd,
123
+ LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_DEFAULT, token)
124
+ if res == 0
125
+ return false
126
+ end
127
+ ::Windows::Handle::CloseHandle.call(token.unpack('L')[0])
128
+ return true
129
+ end
130
+
131
+ def get_info
132
+ ptr = 0.chr * PTR_SIZE
133
+ rc = NetUserGetInfo.call(nil, @name, 3, ptr)
134
+
135
+ if rc != NERR_Success
136
+ raise ArgumentError, get_last_error(rc)
137
+ end
138
+
139
+ ptr = ptr.unpack('L')[0]
140
+ buffer = 0.chr * SIZEOF_USER_INFO_3
141
+ memcpy(buffer, ptr, buffer.size)
142
+ NetApiBufferFree(ptr)
143
+ user_info_3_unpack(buffer)
144
+ end
145
+
146
+ def add(args)
147
+ user = user_info_3(args)
148
+ buffer = user_info_3_pack(user)
149
+
150
+ rc = NetUserAdd.call(nil, 3, buffer, rc)
151
+ if rc != NERR_Success
152
+ raise ArgumentError, get_last_error(rc)
153
+ end
154
+
155
+ #usri3_primary_group_id:
156
+ #"When you call the NetUserAdd function, this member must be DOMAIN_GROUP_RID_USERS"
157
+ NetLocalGroupAddMembers(nil, multi_to_wide("Users"), 3, buffer[0,PTR_SIZE], 1)
158
+ end
159
+
160
+ def user_modify(&proc)
161
+ user = get_info
162
+ user[:last_logon] = user[:units_per_week] = 0 #ignored as per USER_INFO_3 doc
163
+ user[:logon_hours] = nil #PBYTE field; \0 == no changes
164
+ proc.call(user)
165
+ set_info(user)
166
+ end
167
+
168
+ def update(args)
169
+ user_modify do |user|
170
+ args.each do |key,val|
171
+ user[key] = val
172
+ end
173
+ end
174
+ end
175
+
176
+ def delete
177
+ rc = NetUserDel.call(nil, @name)
178
+ if rc != NERR_Success
179
+ raise ArgumentError, get_last_error(rc)
180
+ end
181
+ end
182
+
183
+ def disable_account
184
+ user_modify do |user|
185
+ user[:flags] |= UF_ACCOUNTDISABLE
186
+ end
187
+ end
188
+
189
+ def enable_account
190
+ user_modify do |user|
191
+ user[:flags] &= ~UF_ACCOUNTDISABLE
192
+ end
193
+ end
194
+
195
+ def check_enabled
196
+ (get_info()[:flags] & UF_ACCOUNTDISABLE) != 0
197
+ end
198
+ end
@@ -0,0 +1,20 @@
1
+ #
2
+ # Author:: Daniel DeLeo (<dan@opscode.com>)
3
+ # Copyright:: Copyright (c) 2010 Opscode, Inc.
4
+ # License:: Apache License, Version 2.0
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+
18
+ class Chef
19
+ VERSION = '0.9.0.a3'
20
+ end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ prerelease: true
5
5
  segments:
6
6
  - 0
7
- - 8
8
- - 16
9
- version: 0.8.16
7
+ - 9
8
+ - 0
9
+ - a3
10
+ version: 0.9.0.a3
10
11
  platform: ruby
11
12
  authors:
12
13
  - Adam Jacob
@@ -14,13 +15,14 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-05-11 00:00:00 -07:00
18
+ date: 2010-06-04 00:00:00 -07:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: mixlib-config
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
@@ -35,6 +37,7 @@ dependencies:
35
37
  name: mixlib-cli
36
38
  prerelease: false
37
39
  requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
38
41
  requirements:
39
42
  - - ">="
40
43
  - !ruby/object:Gem::Version
@@ -49,6 +52,7 @@ dependencies:
49
52
  name: mixlib-log
50
53
  prerelease: false
51
54
  requirement: &id003 !ruby/object:Gem::Requirement
55
+ none: false
52
56
  requirements:
53
57
  - - ">="
54
58
  - !ruby/object:Gem::Version
@@ -63,6 +67,7 @@ dependencies:
63
67
  name: mixlib-authentication
64
68
  prerelease: false
65
69
  requirement: &id004 !ruby/object:Gem::Requirement
70
+ none: false
66
71
  requirements:
67
72
  - - ">="
68
73
  - !ruby/object:Gem::Version
@@ -77,6 +82,7 @@ dependencies:
77
82
  name: ohai
78
83
  prerelease: false
79
84
  requirement: &id005 !ruby/object:Gem::Requirement
85
+ none: false
80
86
  requirements:
81
87
  - - ">="
82
88
  - !ruby/object:Gem::Version
@@ -88,9 +94,32 @@ dependencies:
88
94
  type: :runtime
89
95
  version_requirements: *id005
90
96
  - !ruby/object:Gem::Dependency
91
- name: bunny
97
+ name: rest-client
92
98
  prerelease: false
93
99
  requirement: &id006 !ruby/object:Gem::Requirement
100
+ none: false
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ segments:
105
+ - 1
106
+ - 0
107
+ - 4
108
+ version: 1.0.4
109
+ - - <=
110
+ - !ruby/object:Gem::Version
111
+ segments:
112
+ - 1
113
+ - 5
114
+ - 1
115
+ version: 1.5.1
116
+ type: :runtime
117
+ version_requirements: *id006
118
+ - !ruby/object:Gem::Dependency
119
+ name: bunny
120
+ prerelease: false
121
+ requirement: &id007 !ruby/object:Gem::Requirement
122
+ none: false
94
123
  requirements:
95
124
  - - ">="
96
125
  - !ruby/object:Gem::Version
@@ -100,11 +129,12 @@ dependencies:
100
129
  - 0
101
130
  version: 0.6.0
102
131
  type: :runtime
103
- version_requirements: *id006
132
+ version_requirements: *id007
104
133
  - !ruby/object:Gem::Dependency
105
134
  name: json
106
135
  prerelease: false
107
- requirement: &id007 !ruby/object:Gem::Requirement
136
+ requirement: &id008 !ruby/object:Gem::Requirement
137
+ none: false
108
138
  requirements:
109
139
  - - <=
110
140
  - !ruby/object:Gem::Version
@@ -114,11 +144,12 @@ dependencies:
114
144
  - 2
115
145
  version: 1.4.2
116
146
  type: :runtime
117
- version_requirements: *id007
147
+ version_requirements: *id008
118
148
  - !ruby/object:Gem::Dependency
119
149
  name: erubis
120
150
  prerelease: false
121
- requirement: &id008 !ruby/object:Gem::Requirement
151
+ requirement: &id009 !ruby/object:Gem::Requirement
152
+ none: false
122
153
  requirements:
123
154
  - - ">="
124
155
  - !ruby/object:Gem::Version
@@ -126,11 +157,12 @@ dependencies:
126
157
  - 0
127
158
  version: "0"
128
159
  type: :runtime
129
- version_requirements: *id008
160
+ version_requirements: *id009
130
161
  - !ruby/object:Gem::Dependency
131
162
  name: extlib
132
163
  prerelease: false
133
- requirement: &id009 !ruby/object:Gem::Requirement
164
+ requirement: &id010 !ruby/object:Gem::Requirement
165
+ none: false
134
166
  requirements:
135
167
  - - ">="
136
168
  - !ruby/object:Gem::Version
@@ -138,11 +170,12 @@ dependencies:
138
170
  - 0
139
171
  version: "0"
140
172
  type: :runtime
141
- version_requirements: *id009
173
+ version_requirements: *id010
142
174
  - !ruby/object:Gem::Dependency
143
175
  name: moneta
144
176
  prerelease: false
145
- requirement: &id010 !ruby/object:Gem::Requirement
177
+ requirement: &id011 !ruby/object:Gem::Requirement
178
+ none: false
146
179
  requirements:
147
180
  - - ">="
148
181
  - !ruby/object:Gem::Version
@@ -150,7 +183,7 @@ dependencies:
150
183
  - 0
151
184
  version: "0"
152
185
  type: :runtime
153
- version_requirements: *id010
186
+ version_requirements: *id011
154
187
  description: A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.
155
188
  email: adam@opscode.com
156
189
  executables:
@@ -167,18 +200,38 @@ files:
167
200
  - LICENSE
168
201
  - README.rdoc
169
202
  - distro/common/man/man1/chef-indexer.1
203
+ - distro/common/man/man1/chef-server-webui.1
170
204
  - distro/common/man/man1/chef-server.1
205
+ - distro/common/man/man1/chef-solr-indexer.1
206
+ - distro/common/man/man1/chef-solr.1
171
207
  - distro/common/man/man8/chef-client.8
172
208
  - distro/common/man/man8/chef-solo.8
209
+ - distro/common/man/man8/chef-solr-rebuild.8
173
210
  - distro/common/man/man8/knife.8
211
+ - distro/common/man/man8/shef.8
212
+ - distro/common/markdown/knife.mkd
213
+ - distro/common/markdown/README
214
+ - distro/debian/etc/default/chef-client
215
+ - distro/debian/etc/default/chef-server
216
+ - distro/debian/etc/default/chef-server-webui
217
+ - distro/debian/etc/default/chef-solr
218
+ - distro/debian/etc/default/chef-solr-indexer
174
219
  - distro/debian/etc/init.d/chef-client
175
220
  - distro/debian/etc/init.d/chef-server
221
+ - distro/debian/etc/init.d/chef-server-webui
222
+ - distro/debian/etc/init.d/chef-solr
223
+ - distro/debian/etc/init.d/chef-solr-indexer
176
224
  - distro/README
177
225
  - distro/redhat/etc/init.d/chef-client
178
226
  - distro/redhat/etc/init.d/chef-server
179
227
  - distro/redhat/etc/init.d/chef-server-webui
180
228
  - distro/redhat/etc/init.d/chef-solr
181
229
  - distro/redhat/etc/init.d/chef-solr-indexer
230
+ - distro/redhat/etc/logrotate.d/chef-client
231
+ - distro/redhat/etc/logrotate.d/chef-server
232
+ - distro/redhat/etc/logrotate.d/chef-server-webui
233
+ - distro/redhat/etc/logrotate.d/chef-solr
234
+ - distro/redhat/etc/logrotate.d/chef-solr-indexer
182
235
  - distro/redhat/etc/sysconfig/chef-client
183
236
  - distro/redhat/etc/sysconfig/chef-server
184
237
  - distro/redhat/etc/sysconfig/chef-server-webui
@@ -192,25 +245,33 @@ files:
192
245
  - lib/chef/application.rb
193
246
  - lib/chef/applications.rb
194
247
  - lib/chef/cache/checksum.rb
248
+ - lib/chef/cache/file_cache_by_checksum.rb
195
249
  - lib/chef/cache.rb
196
250
  - lib/chef/certificate.rb
251
+ - lib/chef/checksum.rb
197
252
  - lib/chef/client.rb
198
- - lib/chef/compile.rb
199
253
  - lib/chef/config.rb
254
+ - lib/chef/cookbook/cookbook_collection.rb
255
+ - lib/chef/cookbook/file_system_file_vendor.rb
256
+ - lib/chef/cookbook/file_vendor.rb
200
257
  - lib/chef/cookbook/metadata/version.rb
201
258
  - lib/chef/cookbook/metadata.rb
202
- - lib/chef/cookbook.rb
203
259
  - lib/chef/cookbook_loader.rb
260
+ - lib/chef/cookbook_version.rb
204
261
  - lib/chef/couchdb.rb
205
262
  - lib/chef/daemon.rb
206
263
  - lib/chef/data_bag.rb
207
264
  - lib/chef/data_bag_item.rb
208
265
  - lib/chef/exceptions.rb
266
+ - lib/chef/file_access_control.rb
209
267
  - lib/chef/file_cache.rb
268
+ - lib/chef/handler/json_file.rb
269
+ - lib/chef/handler.rb
210
270
  - lib/chef/index_queue/amqp_client.rb
211
271
  - lib/chef/index_queue/consumer.rb
212
272
  - lib/chef/index_queue/indexable.rb
213
273
  - lib/chef/index_queue.rb
274
+ - lib/chef/knife/bootstrap.rb
214
275
  - lib/chef/knife/client_bulk_delete.rb
215
276
  - lib/chef/knife/client_create.rb
216
277
  - lib/chef/knife/client_delete.rb
@@ -239,6 +300,9 @@ files:
239
300
  - lib/chef/knife/data_bag_list.rb
240
301
  - lib/chef/knife/data_bag_show.rb
241
302
  - lib/chef/knife/ec2_instance_data.rb
303
+ - lib/chef/knife/ec2_server_create.rb
304
+ - lib/chef/knife/ec2_server_delete.rb
305
+ - lib/chef/knife/ec2_server_list.rb
242
306
  - lib/chef/knife/index_rebuild.rb
243
307
  - lib/chef/knife/node_bulk_delete.rb
244
308
  - lib/chef/knife/node_create.rb
@@ -261,6 +325,7 @@ files:
261
325
  - lib/chef/knife/role_show.rb
262
326
  - lib/chef/knife/search.rb
263
327
  - lib/chef/knife/ssh.rb
328
+ - lib/chef/knife/status.rb
264
329
  - lib/chef/knife/terremark_server_create.rb
265
330
  - lib/chef/knife/terremark_server_delete.rb
266
331
  - lib/chef/knife/terremark_server_list.rb
@@ -274,12 +339,12 @@ files:
274
339
  - lib/chef/mixin/deep_merge.rb
275
340
  - lib/chef/mixin/find_preferred_file.rb
276
341
  - lib/chef/mixin/from_file.rb
277
- - lib/chef/mixin/generate_url.rb
278
342
  - lib/chef/mixin/language.rb
279
343
  - lib/chef/mixin/language_include_attribute.rb
280
344
  - lib/chef/mixin/language_include_recipe.rb
281
345
  - lib/chef/mixin/params_validate.rb
282
346
  - lib/chef/mixin/recipe_definition_dsl_core.rb
347
+ - lib/chef/mixin/shell_out.rb
283
348
  - lib/chef/mixin/template.rb
284
349
  - lib/chef/mixin/xml_escape.rb
285
350
  - lib/chef/mixins.rb
@@ -288,11 +353,14 @@ files:
288
353
  - lib/chef/openid_registration.rb
289
354
  - lib/chef/platform.rb
290
355
  - lib/chef/provider/breakpoint.rb
356
+ - lib/chef/provider/cookbook_file.rb
291
357
  - lib/chef/provider/cron.rb
292
358
  - lib/chef/provider/deploy/revision.rb
293
359
  - lib/chef/provider/deploy/timestamped.rb
294
360
  - lib/chef/provider/deploy.rb
295
361
  - lib/chef/provider/directory.rb
362
+ - lib/chef/provider/env/windows.rb
363
+ - lib/chef/provider/env.rb
296
364
  - lib/chef/provider/erl_call.rb
297
365
  - lib/chef/provider/execute.rb
298
366
  - lib/chef/provider/file.rb
@@ -302,6 +370,7 @@ files:
302
370
  - lib/chef/provider/group/groupadd.rb
303
371
  - lib/chef/provider/group/pw.rb
304
372
  - lib/chef/provider/group/usermod.rb
373
+ - lib/chef/provider/group/windows.rb
305
374
  - lib/chef/provider/group.rb
306
375
  - lib/chef/provider/http_request.rb
307
376
  - lib/chef/provider/ifconfig.rb
@@ -335,6 +404,7 @@ files:
335
404
  - lib/chef/provider/service/init.rb
336
405
  - lib/chef/provider/service/redhat.rb
337
406
  - lib/chef/provider/service/simple.rb
407
+ - lib/chef/provider/service/solaris.rb
338
408
  - lib/chef/provider/service/upstart.rb
339
409
  - lib/chef/provider/service/windows.rb
340
410
  - lib/chef/provider/service.rb
@@ -343,6 +413,7 @@ files:
343
413
  - lib/chef/provider/user/dscl.rb
344
414
  - lib/chef/provider/user/pw.rb
345
415
  - lib/chef/provider/user/useradd.rb
416
+ - lib/chef/provider/user/windows.rb
346
417
  - lib/chef/provider/user.rb
347
418
  - lib/chef/provider.rb
348
419
  - lib/chef/providers.rb
@@ -350,6 +421,7 @@ files:
350
421
  - lib/chef/resource/apt_package.rb
351
422
  - lib/chef/resource/bash.rb
352
423
  - lib/chef/resource/breakpoint.rb
424
+ - lib/chef/resource/cookbook_file.rb
353
425
  - lib/chef/resource/cron.rb
354
426
  - lib/chef/resource/csh.rb
355
427
  - lib/chef/resource/deploy.rb
@@ -357,6 +429,7 @@ files:
357
429
  - lib/chef/resource/directory.rb
358
430
  - lib/chef/resource/dpkg_package.rb
359
431
  - lib/chef/resource/easy_install_package.rb
432
+ - lib/chef/resource/env.rb
360
433
  - lib/chef/resource/erl_call.rb
361
434
  - lib/chef/resource/execute.rb
362
435
  - lib/chef/resource/file.rb
@@ -400,17 +473,30 @@ files:
400
473
  - lib/chef/rest/rest_request.rb
401
474
  - lib/chef/rest.rb
402
475
  - lib/chef/role.rb
476
+ - lib/chef/run_context.rb
477
+ - lib/chef/run_list/run_list_expansion.rb
478
+ - lib/chef/run_list/run_list_item.rb
403
479
  - lib/chef/run_list.rb
404
480
  - lib/chef/runner.rb
481
+ - lib/chef/sandbox.rb
405
482
  - lib/chef/search/query.rb
406
483
  - lib/chef/shef/ext.rb
407
484
  - lib/chef/shef/shef_session.rb
408
485
  - lib/chef/shef.rb
486
+ - lib/chef/shell_out.rb
409
487
  - lib/chef/streaming_cookbook_uploader.rb
410
488
  - lib/chef/tasks/chef_repo.rake
411
489
  - lib/chef/util/file_edit.rb
490
+ - lib/chef/util/windows/net_group.rb
491
+ - lib/chef/util/windows/net_user.rb
492
+ - lib/chef/util/windows.rb
493
+ - lib/chef/version.rb
412
494
  - lib/chef/webui_user.rb
413
495
  - lib/chef.rb
496
+ - bin/chef-client
497
+ - bin/chef-solo
498
+ - bin/knife
499
+ - bin/shef
414
500
  has_rdoc: true
415
501
  homepage: http://wiki.opscode.com/display/chef
416
502
  licenses: []
@@ -421,6 +507,7 @@ rdoc_options: []
421
507
  require_paths:
422
508
  - lib
423
509
  required_ruby_version: !ruby/object:Gem::Requirement
510
+ none: false
424
511
  requirements:
425
512
  - - ">="
426
513
  - !ruby/object:Gem::Version
@@ -428,16 +515,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
428
515
  - 0
429
516
  version: "0"
430
517
  required_rubygems_version: !ruby/object:Gem::Requirement
518
+ none: false
431
519
  requirements:
432
- - - ">="
520
+ - - ">"
433
521
  - !ruby/object:Gem::Version
434
522
  segments:
435
- - 0
436
- version: "0"
523
+ - 1
524
+ - 3
525
+ - 1
526
+ version: 1.3.1
437
527
  requirements: []
438
528
 
439
529
  rubyforge_project:
440
- rubygems_version: 1.3.6
530
+ rubygems_version: 1.3.7
441
531
  signing_key:
442
532
  specification_version: 3
443
533
  summary: A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.