from-scratch 0.3.0 → 0.5.0

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.
Files changed (209) hide show
  1. checksums.yaml +4 -4
  2. data/Berksfile +2 -1
  3. data/Berksfile.lock +20 -1
  4. data/cookbooks/bluepill/CHANGELOG.md +93 -0
  5. data/cookbooks/bluepill/README.md +91 -0
  6. data/cookbooks/bluepill/attributes/default.rb +44 -0
  7. data/cookbooks/bluepill/metadata.json +1 -0
  8. data/cookbooks/bluepill/providers/service.rb +172 -0
  9. data/cookbooks/bluepill/recipes/default.rb +48 -0
  10. data/cookbooks/bluepill/recipes/rsyslog.rb +28 -0
  11. data/cookbooks/bluepill/resources/service.rb +27 -0
  12. data/cookbooks/bluepill/templates/default/bluepill_init.fedora.erb +34 -0
  13. data/cookbooks/bluepill/templates/default/bluepill_init.freebsd.erb +32 -0
  14. data/cookbooks/bluepill/templates/default/bluepill_init.lsb.erb +37 -0
  15. data/cookbooks/bluepill/templates/default/bluepill_init.rhel.erb +34 -0
  16. data/cookbooks/bluepill/templates/default/bluepill_rsyslog.conf.erb +1 -0
  17. data/cookbooks/nginx/CHANGELOG.md +435 -0
  18. data/cookbooks/nginx/README.md +521 -0
  19. data/cookbooks/nginx/attributes/auth_request.rb +23 -0
  20. data/cookbooks/nginx/attributes/default.rb +131 -0
  21. data/cookbooks/nginx/attributes/devel.rb +24 -0
  22. data/cookbooks/nginx/attributes/echo.rb +24 -0
  23. data/cookbooks/nginx/attributes/geoip.rb +31 -0
  24. data/cookbooks/nginx/attributes/headers_more.rb +24 -0
  25. data/cookbooks/nginx/attributes/lua.rb +28 -0
  26. data/cookbooks/nginx/attributes/naxsi.rb +24 -0
  27. data/cookbooks/nginx/attributes/openssl_source.rb +23 -0
  28. data/cookbooks/nginx/attributes/pagespeed.rb +9 -0
  29. data/cookbooks/nginx/attributes/passenger.rb +58 -0
  30. data/cookbooks/nginx/attributes/rate_limiting.rb +23 -0
  31. data/cookbooks/nginx/attributes/repo.rb +35 -0
  32. data/cookbooks/nginx/attributes/set_misc.rb +8 -0
  33. data/cookbooks/nginx/attributes/socketproxy.rb +13 -0
  34. data/cookbooks/nginx/attributes/source.rb +42 -0
  35. data/cookbooks/nginx/attributes/status.rb +22 -0
  36. data/cookbooks/nginx/attributes/syslog.rb +24 -0
  37. data/cookbooks/nginx/attributes/upload_progress.rb +26 -0
  38. data/cookbooks/nginx/definitions/nginx_site.rb +50 -0
  39. data/cookbooks/nginx/files/default/mime.types +78 -0
  40. data/cookbooks/nginx/files/default/naxsi_core.rules +82 -0
  41. data/cookbooks/nginx/libraries/matchers.rb +20 -0
  42. data/cookbooks/nginx/metadata.json +351 -0
  43. data/cookbooks/nginx/recipes/authorized_ips.rb +32 -0
  44. data/cookbooks/nginx/recipes/commons.rb +24 -0
  45. data/cookbooks/nginx/recipes/commons_conf.rb +42 -0
  46. data/cookbooks/nginx/recipes/commons_dir.rb +57 -0
  47. data/cookbooks/nginx/recipes/commons_script.rb +29 -0
  48. data/cookbooks/nginx/recipes/default.rb +31 -0
  49. data/cookbooks/nginx/recipes/headers_more_module.rb +50 -0
  50. data/cookbooks/nginx/recipes/http_auth_request_module.rb +52 -0
  51. data/cookbooks/nginx/recipes/http_echo_module.rb +46 -0
  52. data/cookbooks/nginx/recipes/http_geoip_module.rb +113 -0
  53. data/cookbooks/nginx/recipes/http_gzip_static_module.rb +30 -0
  54. data/cookbooks/nginx/recipes/http_mp4_module.rb +2 -0
  55. data/cookbooks/nginx/recipes/http_perl_module.rb +23 -0
  56. data/cookbooks/nginx/recipes/http_realip_module.rb +38 -0
  57. data/cookbooks/nginx/recipes/http_spdy_module.rb +23 -0
  58. data/cookbooks/nginx/recipes/http_ssl_module.rb +23 -0
  59. data/cookbooks/nginx/recipes/http_stub_status_module.rb +36 -0
  60. data/cookbooks/nginx/recipes/ipv6.rb +23 -0
  61. data/cookbooks/nginx/recipes/lua.rb +47 -0
  62. data/cookbooks/nginx/recipes/naxsi_module.rb +52 -0
  63. data/cookbooks/nginx/recipes/ngx_devel_module.rb +44 -0
  64. data/cookbooks/nginx/recipes/ngx_lua_module.rb +47 -0
  65. data/cookbooks/nginx/recipes/ohai_plugin.rb +35 -0
  66. data/cookbooks/nginx/recipes/openssl_source.rb +45 -0
  67. data/cookbooks/nginx/recipes/package.rb +52 -0
  68. data/cookbooks/nginx/recipes/pagespeed_module.rb +62 -0
  69. data/cookbooks/nginx/recipes/passenger.rb +56 -0
  70. data/cookbooks/nginx/recipes/repo.rb +41 -0
  71. data/cookbooks/nginx/recipes/repo_passenger.rb +39 -0
  72. data/cookbooks/nginx/recipes/set_misc.rb +30 -0
  73. data/cookbooks/nginx/recipes/socketproxy.rb +26 -0
  74. data/cookbooks/nginx/recipes/source.rb +205 -0
  75. data/cookbooks/nginx/recipes/syslog_module.rb +69 -0
  76. data/cookbooks/nginx/recipes/upload_progress_module.rb +53 -0
  77. data/cookbooks/nginx/templates/debian/nginx.init.erb +97 -0
  78. data/cookbooks/nginx/templates/default/default-site.erb +11 -0
  79. data/cookbooks/nginx/templates/default/modules/authorized_ip.erb +6 -0
  80. data/cookbooks/nginx/templates/default/modules/http_geoip.conf.erb +4 -0
  81. data/cookbooks/nginx/templates/default/modules/http_gzip_static.conf.erb +1 -0
  82. data/cookbooks/nginx/templates/default/modules/http_realip.conf.erb +7 -0
  83. data/cookbooks/nginx/templates/default/modules/nginx_status.erb +14 -0
  84. data/cookbooks/nginx/templates/default/modules/passenger.conf.erb +13 -0
  85. data/cookbooks/nginx/templates/default/modules/socketproxy.conf.erb +89 -0
  86. data/cookbooks/nginx/templates/default/modules/upload_progress.erb +4 -0
  87. data/cookbooks/nginx/templates/default/nginx-upstart.conf.erb +39 -0
  88. data/cookbooks/nginx/templates/default/nginx.conf.erb +103 -0
  89. data/cookbooks/nginx/templates/default/nginx.init.erb +111 -0
  90. data/cookbooks/nginx/templates/default/nginx.pill.erb +15 -0
  91. data/cookbooks/nginx/templates/default/nginx.sysconfig.erb +1 -0
  92. data/cookbooks/nginx/templates/default/nxdissite.erb +29 -0
  93. data/cookbooks/nginx/templates/default/nxensite.erb +38 -0
  94. data/cookbooks/nginx/templates/default/plugins/nginx.rb.erb +66 -0
  95. data/cookbooks/nginx/templates/default/sv-nginx-log-run.erb +2 -0
  96. data/cookbooks/nginx/templates/default/sv-nginx-run.erb +4 -0
  97. data/cookbooks/nginx/templates/gentoo/nginx.init.erb +87 -0
  98. data/cookbooks/nginx/templates/suse/nginx.init.erb +115 -0
  99. data/cookbooks/nginx/templates/ubuntu/nginx.init.erb +97 -0
  100. data/cookbooks/ohai/CHANGELOG.md +69 -0
  101. data/cookbooks/ohai/README.md +89 -0
  102. data/cookbooks/ohai/attributes/default.rb +31 -0
  103. data/cookbooks/ohai/files/default/plugins/README +1 -0
  104. data/cookbooks/ohai/libraries/matchers.rb +14 -0
  105. data/cookbooks/ohai/metadata.json +1 -0
  106. data/cookbooks/ohai/providers/hint.rb +38 -0
  107. data/cookbooks/ohai/recipes/default.rb +52 -0
  108. data/cookbooks/ohai/resources/hint.rb +5 -0
  109. data/cookbooks/packagecloud/CHANGELOG.md +12 -0
  110. data/cookbooks/packagecloud/README.md +80 -0
  111. data/cookbooks/packagecloud/attributes/default.rb +8 -0
  112. data/cookbooks/packagecloud/libraries/helper.rb +43 -0
  113. data/cookbooks/packagecloud/libraries/matcher.rb +7 -0
  114. data/cookbooks/packagecloud/metadata.json +1 -0
  115. data/cookbooks/packagecloud/providers/repo.rb +212 -0
  116. data/cookbooks/packagecloud/resources/repo.rb +10 -0
  117. data/cookbooks/packagecloud/templates/.kitchen/logs/kitchen.log +29 -0
  118. data/cookbooks/packagecloud/templates/default/apt.erb +2 -0
  119. data/cookbooks/packagecloud/templates/default/yum.erb +15 -0
  120. data/cookbooks/rsyslog/CHANGELOG.md +193 -0
  121. data/cookbooks/rsyslog/README.md +276 -0
  122. data/cookbooks/rsyslog/attributes/default.rb +131 -0
  123. data/cookbooks/rsyslog/libraries/helpers.rb +25 -0
  124. data/cookbooks/rsyslog/metadata.json +1 -0
  125. data/cookbooks/rsyslog/providers/file_input.rb +44 -0
  126. data/cookbooks/rsyslog/recipes/client.rb +87 -0
  127. data/cookbooks/rsyslog/recipes/default.rb +89 -0
  128. data/cookbooks/rsyslog/recipes/server.rb +44 -0
  129. data/cookbooks/rsyslog/resources/file_input.rb +28 -0
  130. data/cookbooks/rsyslog/templates/default/35-server-per-host.conf.erb +62 -0
  131. data/cookbooks/rsyslog/templates/default/49-relp.conf.erb +10 -0
  132. data/cookbooks/rsyslog/templates/default/49-remote.conf.erb +30 -0
  133. data/cookbooks/rsyslog/templates/default/50-default.conf.erb +6 -0
  134. data/cookbooks/rsyslog/templates/default/file-input.conf.erb +15 -0
  135. data/cookbooks/rsyslog/templates/default/omnios-manifest.xml.erb +30 -0
  136. data/cookbooks/rsyslog/templates/default/rsyslog.conf.erb +117 -0
  137. data/cookbooks/rsyslog/templates/smartos/50-default.conf.erb +18 -0
  138. data/cookbooks/runit/.kitchen.cloud.yml +103 -0
  139. data/cookbooks/runit/.kitchen.yml +38 -0
  140. data/cookbooks/runit/.rspec +3 -0
  141. data/cookbooks/runit/.rubocop.yml +45 -0
  142. data/cookbooks/runit/Berksfile.disabled +11 -0
  143. data/cookbooks/runit/CHANGELOG.md +226 -0
  144. data/cookbooks/runit/CONTRIBUTING.md +266 -0
  145. data/cookbooks/runit/Cheffile +11 -0
  146. data/cookbooks/runit/Gemfile +17 -0
  147. data/cookbooks/runit/LICENSE +201 -0
  148. data/cookbooks/runit/README.md +435 -0
  149. data/cookbooks/runit/Rakefile +23 -0
  150. data/cookbooks/runit/TESTING.md +26 -0
  151. data/cookbooks/runit/attributes/default.rb +62 -0
  152. data/cookbooks/runit/files/default/runit.seed +1 -0
  153. data/cookbooks/runit/files/default/runsvdir +0 -0
  154. data/cookbooks/runit/files/ubuntu-6.10/runsvdir +6 -0
  155. data/cookbooks/runit/files/ubuntu-7.04/runsvdir +7 -0
  156. data/cookbooks/runit/files/ubuntu-7.10/runsvdir +7 -0
  157. data/cookbooks/runit/files/ubuntu-8.04/runsvdir +7 -0
  158. data/cookbooks/runit/libraries/default.rb +0 -0
  159. data/cookbooks/runit/libraries/helpers.rb +190 -0
  160. data/cookbooks/runit/libraries/matchers.rb +69 -0
  161. data/cookbooks/runit/libraries/provider_runit_service.rb +326 -0
  162. data/cookbooks/runit/libraries/resource_runit_service.rb +267 -0
  163. data/cookbooks/runit/metadata.json +50 -0
  164. data/cookbooks/runit/recipes/default.rb +91 -0
  165. data/cookbooks/runit/templates/debian/init.d.erb +66 -0
  166. data/cookbooks/runit/templates/default/log-config.erb +24 -0
  167. data/cookbooks/runit/templates/gentoo/runit-start.sh.erb +32 -0
  168. data/cookbooks/scratchify/Berksfile +2 -1
  169. data/cookbooks/scratchify/Berksfile.lock +20 -1
  170. data/cookbooks/scratchify/lib/from-scratch.rb +1 -4
  171. data/cookbooks/scratchify/lib/from-scratch/version.rb +1 -1
  172. data/cookbooks/scratchify/metadata.json +5 -2
  173. data/cookbooks/scratchify/recipes/default.rb +15 -1
  174. data/cookbooks/scratchify/recipes/nginx_site.rb +4 -0
  175. data/cookbooks/scratchify/recipes/pre_rvm.rb +5 -0
  176. data/cookbooks/scratchify/templates/nginx.erb +31 -0
  177. data/cookbooks/scratchify/templates/node.json.erb +21 -6
  178. data/cookbooks/yum-epel/CHANGELOG.md +84 -0
  179. data/cookbooks/yum-epel/README.md +172 -0
  180. data/cookbooks/yum-epel/attributes/default.rb +1 -0
  181. data/cookbooks/yum-epel/attributes/epel-debuginfo.rb +28 -0
  182. data/cookbooks/yum-epel/attributes/epel-source.rb +28 -0
  183. data/cookbooks/yum-epel/attributes/epel-testing-debuginfo.rb +28 -0
  184. data/cookbooks/yum-epel/attributes/epel-testing-source.rb +28 -0
  185. data/cookbooks/yum-epel/attributes/epel-testing.rb +28 -0
  186. data/cookbooks/yum-epel/attributes/epel.rb +28 -0
  187. data/cookbooks/yum-epel/metadata.json +1 -0
  188. data/cookbooks/yum-epel/recipes/default.rb +61 -0
  189. data/cookbooks/yum/CHANGELOG.md +294 -0
  190. data/cookbooks/yum/README.md +285 -0
  191. data/cookbooks/yum/attributes/main.rb +100 -0
  192. data/cookbooks/yum/libraries/matchers.rb +27 -0
  193. data/cookbooks/yum/metadata.json +1 -0
  194. data/cookbooks/yum/providers/globalconfig.rb +41 -0
  195. data/cookbooks/yum/providers/repository.rb +106 -0
  196. data/cookbooks/yum/recipes/default.rb +26 -0
  197. data/cookbooks/yum/resources/globalconfig.rb +109 -0
  198. data/cookbooks/yum/resources/repository.rb +69 -0
  199. data/cookbooks/yum/templates/default/main.erb +276 -0
  200. data/cookbooks/yum/templates/default/repo.erb +125 -0
  201. data/lib/from-scratch.rb +1 -0
  202. data/lib/from-scratch/version.rb +1 -1
  203. data/metadata.rb +5 -1
  204. data/recipes/default.rb +15 -1
  205. data/recipes/nginx_site.rb +4 -0
  206. data/recipes/pre_rvm.rb +5 -0
  207. data/templates/nginx.erb +31 -0
  208. data/templates/node.json.erb +21 -6
  209. metadata +194 -1
@@ -0,0 +1,106 @@
1
+ #
2
+ # Cookbook Name:: yum
3
+ # Provider:: repository
4
+ #
5
+ # Author:: Sean OMeara <someara@chef.io>
6
+ # Copyright 2013, Chef
7
+ #
8
+ # Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ # See the License for the specific language governing permissions and
18
+ # limitations under the License.
19
+ #
20
+
21
+ # In Chef 11 and above, calling the use_inline_resources method will
22
+ # make Chef create a new "run_context". When an action is called, any
23
+ # nested resources are compiled and converged in isolation from the
24
+ # recipe that calls it.
25
+
26
+ # Allow for Chef 10 support
27
+ use_inline_resources if defined?(use_inline_resources)
28
+
29
+ def whyrun_supported?
30
+ true
31
+ end
32
+
33
+ action :create do
34
+ # Hack around the lack of "use_inline_resources" before Chef 11 by
35
+ # uniquely naming the execute[yum-makecache] resources. Set the
36
+ # notifies timing to :immediately for the same reasons. Remove both
37
+ # of these when dropping Chef 10 support.
38
+
39
+ template "/etc/yum.repos.d/#{new_resource.repositoryid}.repo" do
40
+ if new_resource.source.nil?
41
+ source 'repo.erb'
42
+ cookbook 'yum'
43
+ else
44
+ source new_resource.source
45
+ end
46
+ mode new_resource.mode
47
+ variables(config: new_resource)
48
+ if new_resource.make_cache
49
+ notifies :run, "execute[yum clean headers #{new_resource.repositoryid}]", :immediately if new_resource.clean_headers
50
+ notifies :run, "execute[yum-makecache-#{new_resource.repositoryid}]", :immediately
51
+ notifies :create, "ruby_block[yum-cache-reload-#{new_resource.repositoryid}]", :immediately
52
+ end
53
+ end
54
+
55
+ execute "yum clean headers #{new_resource.repositoryid}" do
56
+ command "yum clean headers --disablerepo=* --enablerepo=#{new_resource.repositoryid}"
57
+ action :nothing
58
+ end
59
+
60
+ # get the metadata for this repo only
61
+ execute "yum-makecache-#{new_resource.repositoryid}" do
62
+ command "yum -q -y makecache --disablerepo=* --enablerepo=#{new_resource.repositoryid}"
63
+ action :nothing
64
+ only_if { new_resource.enabled }
65
+ end
66
+
67
+ # reload internal Chef yum cache
68
+ ruby_block "yum-cache-reload-#{new_resource.repositoryid}" do
69
+ block { Chef::Provider::Package::Yum::YumCache.instance.reload }
70
+ action :nothing
71
+ end
72
+ end
73
+
74
+ action :delete do
75
+ file "/etc/yum.repos.d/#{new_resource.repositoryid}.repo" do
76
+ action :delete
77
+ notifies :run, "execute[yum clean all #{new_resource.repositoryid}]", :immediately
78
+ notifies :create, "ruby_block[yum-cache-reload-#{new_resource.repositoryid}]", :immediately
79
+ end
80
+
81
+ execute "yum clean all #{new_resource.repositoryid}" do
82
+ command "yum clean all --disablerepo=* --enablerepo=#{new_resource.repositoryid}"
83
+ only_if "yum repolist | grep -P '^#{new_resource.repositoryid}([ \t]|$)'"
84
+ action :nothing
85
+ end
86
+
87
+ ruby_block "yum-cache-reload-#{new_resource.repositoryid}" do
88
+ block { Chef::Provider::Package::Yum::YumCache.instance.reload }
89
+ action :nothing
90
+ end
91
+ end
92
+
93
+ action :makecache do
94
+ execute "yum-makecache-#{new_resource.repositoryid}" do
95
+ command "yum -q makecache --disablerepo=* --enablerepo=#{new_resource.repositoryid}"
96
+ action :run
97
+ end
98
+
99
+ ruby_block "yum-cache-reload-#{new_resource.repositoryid}" do
100
+ block { Chef::Provider::Package::Yum::YumCache.instance.reload }
101
+ action :run
102
+ end
103
+ end
104
+
105
+ alias_method :action_add, :action_create
106
+ alias_method :action_remove, :action_delete
@@ -0,0 +1,26 @@
1
+ #
2
+ # Author:: Sean OMeara (<someara@chef.io>)
3
+ # Author:: Joshua Timberman (<joshua@chef.io>)
4
+ # Recipe:: yum::default
5
+ #
6
+ # Copyright 2013-2014, Chef Software, Inc (<legal@chef.io>)
7
+ #
8
+ # Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ # See the License for the specific language governing permissions and
18
+ # limitations under the License.
19
+
20
+ yum_globalconfig '/etc/yum.conf' do
21
+ node['yum']['main'].each do |config, value|
22
+ send(config.to_sym, value) unless value.nil?
23
+ end
24
+
25
+ action :create
26
+ end
@@ -0,0 +1,109 @@
1
+ #
2
+ # Cookbook Name:: yum
3
+ # Resource:: repository
4
+ #
5
+ # Author:: Sean OMeara <someara@chef.io>
6
+ # Copyright 2013, Chef
7
+ #
8
+ # Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ # See the License for the specific language governing permissions and
18
+ # limitations under the License.
19
+ #
20
+
21
+ actions :create, :delete
22
+
23
+ default_action :create
24
+
25
+ # http://linux.die.net/man/5/yum.conf
26
+ attribute :alwaysprompt, kind_of: [TrueClass, FalseClass], default: nil
27
+ attribute :assumeyes, kind_of: [TrueClass, FalseClass], default: nil
28
+ attribute :bandwidth, kind_of: String, regex: /^\d+/, default: nil
29
+ attribute :bugtracker_url, kind_of: String, regex: /.*/, default: nil
30
+ attribute :clean_requirements_on_remove, kind_of: [TrueClass, FalseClass], default: nil
31
+ attribute :cachedir, kind_of: String, regex: /.*/, default: '/var/cache/yum/$basearch/$releasever'
32
+ attribute :color, kind_of: String, equal_to: %w(always never), default: nil
33
+ attribute :color_list_available_downgrade, kind_of: String, regex: /.*/, default: nil
34
+ attribute :color_list_available_install, kind_of: String, regex: /.*/, default: nil
35
+ attribute :color_list_available_reinstall, kind_of: String, regex: /.*/, default: nil
36
+ attribute :color_list_available_upgrade, kind_of: String, regex: /.*/, default: nil
37
+ attribute :color_list_installed_extra, kind_of: String, regex: /.*/, default: nil
38
+ attribute :color_list_installed_newer, kind_of: String, regex: /.*/, default: nil
39
+ attribute :color_list_installed_older, kind_of: String, regex: /.*/, default: nil
40
+ attribute :color_list_installed_reinstall, kind_of: String, regex: /.*/, default: nil
41
+ attribute :color_search_match, kind_of: String, regex: /.*/, default: nil
42
+ attribute :color_update_installed, kind_of: String, regex: /.*/, default: nil
43
+ attribute :color_update_local, kind_of: String, regex: /.*/, default: nil
44
+ attribute :color_update_remote, kind_of: String, regex: /.*/, default: nil
45
+ attribute :commands, kind_of: String, regex: /.*/, default: nil
46
+ attribute :debuglevel, kind_of: String, regex: /^\d+$/, default: '2'
47
+ attribute :deltarpm, kind_of: [TrueClass, FalseClass], default: nil
48
+ attribute :diskspacecheck, kind_of: [TrueClass, FalseClass], default: nil
49
+ attribute :distroverpkg, kind_of: String, regex: /.*/, default: nil
50
+ attribute :enable_group_conditionals, kind_of: [TrueClass, FalseClass], default: nil
51
+ attribute :errorlevel, kind_of: String, regex: /^\d+$/, default: nil
52
+ attribute :exactarch, kind_of: [TrueClass, FalseClass], default: true
53
+ attribute :exclude, kind_of: String, regex: /.*/, default: nil
54
+ attribute :gpgcheck, kind_of: [TrueClass, FalseClass], default: true
55
+ attribute :group_package_types, kind_of: String, regex: /.*/, default: nil
56
+ attribute :groupremove_leaf_only, kind_of: [TrueClass, FalseClass], default: nil
57
+ attribute :history_list_view, kind_of: String, equal_to: %w(users commands single-user-commands), default: nil
58
+ attribute :history_record, kind_of: [TrueClass, FalseClass], default: nil
59
+ attribute :history_record_packages, kind_of: String, regex: /.*/, default: nil
60
+ attribute :http_caching, kind_of: String, equal_to: %w(packages all none), default: nil
61
+ attribute :installonly_limit, kind_of: String, regex: [/^\d+/, /keep/], default: '3'
62
+ attribute :installonlypkgs, kind_of: String, regex: /.*/, default: nil
63
+ attribute :installroot, kind_of: String, regex: /.*/, default: nil
64
+ attribute :keepalive, kind_of: [TrueClass, FalseClass], default: nil
65
+ attribute :keepcache, kind_of: [TrueClass, FalseClass], default: false
66
+ attribute :kernelpkgnames, kind_of: String, regex: /.*/, default: nil
67
+ attribute :localpkg_gpgcheck, kind_of: [TrueClass, FalseClass], default: nil
68
+ attribute :logfile, kind_of: String, regex: /.*/, default: '/var/log/yum.log'
69
+ attribute :max_retries, kind_of: String, regex: /^\d+$/, default: nil
70
+ attribute :mdpolicy, kind_of: String, equal_to: %w(instant group:primary group:small group:main group:all), default: nil
71
+ attribute :metadata_expire, kind_of: String, regex: [/^\d+$/, /^\d+[mhd]$/, /never/], default: nil
72
+ attribute :mirrorlist_expire, kind_of: String, regex: /^\d+$/, default: nil
73
+ attribute :multilib_policy, kind_of: String, equal_to: %w(all best), default: nil
74
+ attribute :obsoletes, kind_of: [TrueClass, FalseClass], default: nil
75
+ attribute :overwrite_groups, kind_of: [TrueClass, FalseClass], default: nil
76
+ attribute :password, kind_of: String, regex: /.*/, default: nil
77
+ attribute :path, kind_of: String, regex: /.*/, name_attribute: true
78
+ attribute :persistdir, kind_of: String, regex: /.*/, default: nil
79
+ attribute :pluginconfpath, kind_of: String, regex: /.*/, default: nil
80
+ attribute :pluginpath, kind_of: String, regex: /.*/, default: nil
81
+ attribute :plugins, kind_of: [TrueClass, FalseClass], default: true
82
+ attribute :protected_multilib, kind_of: [TrueClass, FalseClass], default: nil
83
+ attribute :protected_packages, kind_of: String, regex: /.*/, default: nil
84
+ attribute :proxy, kind_of: String, regex: /.*/, default: nil
85
+ attribute :proxy_password, kind_of: String, regex: /.*/, default: nil
86
+ attribute :proxy_username, kind_of: String, regex: /.*/, default: nil
87
+ attribute :recent, kind_of: String, regex: /^\d+$/, default: nil
88
+ attribute :releasever, kind_of: String, regex: /.*/, default: nil
89
+ attribute :repo_gpgcheck, kind_of: [TrueClass, FalseClass], default: nil
90
+ attribute :reposdir, kind_of: String, regex: /.*/, default: nil
91
+ attribute :reset_nice, kind_of: [TrueClass, FalseClass], default: nil
92
+ attribute :rpmverbosity, kind_of: String, equal_to: %w(info critical emergency error warn debug), default: nil
93
+ attribute :showdupesfromrepos, kind_of: [TrueClass, FalseClass], default: nil
94
+ attribute :skip_broken, kind_of: [TrueClass, FalseClass], default: nil
95
+ attribute :ssl_check_cert_permissions, kind_of: [TrueClass, FalseClass], default: nil
96
+ attribute :sslcacert, kind_of: String, regex: /.*/, default: nil
97
+ attribute :sslclientcert, kind_of: String, regex: /.*/, default: nil
98
+ attribute :sslclientkey, kind_of: String, regex: /.*/, default: nil
99
+ attribute :sslverify, kind_of: [TrueClass, FalseClass], default: nil
100
+ attribute :syslog_device, kind_of: String, regex: /.*/, default: nil
101
+ attribute :syslog_facility, kind_of: String, regex: /.*/, default: nil
102
+ attribute :syslog_ident, kind_of: String, regex: /.*/, default: nil
103
+ attribute :throttle, kind_of: String, regex: [/\d+k/, /\d+M/, /\d+G/], default: nil
104
+ attribute :timeout, kind_of: String, regex: /^\d+$/, default: nil
105
+ attribute :tolerant, kind_of: [TrueClass, FalseClass], default: nil
106
+ attribute :tsflags, kind_of: String, regex: /.*/, default: nil
107
+ attribute :username, kind_of: String, regex: /.*/, default: nil
108
+
109
+ attribute :options, kind_of: Hash
@@ -0,0 +1,69 @@
1
+ #
2
+ # Cookbook Name:: yum
3
+ # Resource:: repository
4
+ #
5
+ # Author:: Sean OMeara <someara@chef.io>
6
+ # Copyright 2013, Chef
7
+ #
8
+ # Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ # See the License for the specific language governing permissions and
18
+ # limitations under the License.
19
+ #
20
+
21
+ actions :create, :delete, :add, :remove, :makecache
22
+
23
+ default_action :create
24
+
25
+ # http://linux.die.net/man/5/yum.conf
26
+ attribute :baseurl, kind_of: String, regex: /.*/, default: nil
27
+ attribute :cost, kind_of: String, regex: /^\d+$/, default: nil
28
+ attribute :clean_headers, kind_of: [TrueClass, FalseClass], default: true
29
+ attribute :description, kind_of: String, regex: /.*/, default: 'Ye Ole Rpm Repo'
30
+ attribute :enabled, kind_of: [TrueClass, FalseClass], default: true
31
+ attribute :enablegroups, kind_of: [TrueClass, FalseClass], default: nil
32
+ attribute :exclude, kind_of: String, regex: /.*/, default: nil
33
+ attribute :failovermethod, kind_of: String, equal_to: %w(priority roundrobin), default: nil
34
+ attribute :fastestmirror_enabled, kind_of: [TrueClass, FalseClass], default: nil
35
+ attribute :gpgcheck, kind_of: [TrueClass, FalseClass], default: true
36
+ attribute :gpgkey, kind_of: [String, Array], regex: /.*/, default: nil
37
+ attribute :http_caching, kind_of: String, equal_to: %w(packages all none), default: nil
38
+ attribute :include_config, kind_of: String, regex: /.*/, default: nil
39
+ attribute :includepkgs, kind_of: String, regex: /.*/, default: nil
40
+ attribute :keepalive, kind_of: [TrueClass, FalseClass], default: nil
41
+ attribute :make_cache, kind_of: [TrueClass, FalseClass], default: true
42
+ attribute :max_retries, kind_of: [String, Integer], default: nil
43
+ attribute :metadata_expire, kind_of: String, regex: [/^\d+$/, /^\d+[mhd]$/, /never/], default: nil
44
+ attribute :mirrorexpire, kind_of: String, regex: /.*/, default: nil
45
+ attribute :mirrorlist, kind_of: String, regex: /.*/, default: nil
46
+ attribute :mirror_expire, kind_of: String, regex: [/^\d+$/, /^\d+[mhd]$/], default: nil
47
+ attribute :mirrorlist_expire, kind_of: String, regex: [/^\d+$/, /^\d+[mhd]$/], default: nil
48
+ attribute :mode, default: '0644'
49
+ attribute :priority, kind_of: String, regex: /^(\d?[0-9]|[0-9][0-9])$/, default: nil
50
+ attribute :proxy, kind_of: String, regex: /.*/, default: nil
51
+ attribute :proxy_username, kind_of: String, regex: /.*/, default: nil
52
+ attribute :proxy_password, kind_of: String, regex: /.*/, default: nil
53
+ attribute :username, kind_of: String, regex: /.*/, default: nil
54
+ attribute :password, kind_of: String, regex: /.*/, default: nil
55
+ attribute :repo_gpgcheck, kind_of: [TrueClass, FalseClass], default: nil
56
+ attribute :report_instanceid, kind_of: [TrueClass, FalseClass], default: nil
57
+ attribute :repositoryid, kind_of: String, regex: /.*/, name_attribute: true
58
+ attribute :skip_if_unavailable, kind_of: [TrueClass, FalseClass], default: nil
59
+ attribute :source, kind_of: String, regex: /.*/, default: nil
60
+ attribute :sslcacert, kind_of: String, regex: /.*/, default: nil
61
+ attribute :sslclientcert, kind_of: String, regex: /.*/, default: nil
62
+ attribute :sslclientkey, kind_of: String, regex: /.*/, default: nil
63
+ attribute :sslverify, kind_of: [TrueClass, FalseClass], default: nil
64
+ attribute :timeout, kind_of: String, regex: /^\d+$/, default: nil
65
+
66
+ attribute :options, kind_of: Hash
67
+
68
+ alias_method :url, :baseurl
69
+ alias_method :keyurl, :gpgkey
@@ -0,0 +1,276 @@
1
+ # This file was generated by Chef
2
+ # Do NOT modify this file by hand.
3
+
4
+ [main]
5
+ <% if @config.alwaysprompt %>
6
+ alwaysprompt=<%= @config.alwaysprompt %>
7
+ <% end %>
8
+ <% if @config.assumeyes %>
9
+ assumeyes=<%= @config.assumeyes %>
10
+ <% end %>
11
+ <% if @config.bandwidth %>
12
+ bandwidth=<%= @config.bandwidth %>
13
+ <% end %>
14
+ <% if @config.bugtracker_url %>
15
+ bugtracker_url=<%= @config.bugtracker_url %>
16
+ <% end %>
17
+ <% if @config.cachedir %>
18
+ cachedir=<%= @config.cachedir %>
19
+ <% end %>
20
+ <% if @config.clean_requirements_on_remove %>
21
+ clean_requirements_on_remove=<%= @config.clean_requirements_on_remove %>
22
+ <% end %>
23
+ <% if @config.color %>
24
+ color=<%= @config.color %>
25
+ <% end %>
26
+ <% if @config.color_list_available_downgrade %>
27
+ color_list_available_downgrade=<%= @config.color_list_available_downgrade %>
28
+ <% end %>
29
+ <% if @config.color_list_available_install %>
30
+ color_list_available_install=<%= @config.color_list_available_install %>
31
+ <% end %>
32
+ <% if @config.color_list_available_reinstall %>
33
+ color_list_available_reinstall=<%= @config.color_list_available_reinstall %>
34
+ <% end %>
35
+ <% if @config.color_list_available_upgrade %>
36
+ color_list_available_upgrade=<%= @config.color_list_available_upgrade %>
37
+ <% end %>
38
+ <% if @config.color_list_installed_extra %>
39
+ color_list_installed_extra=<%= @config.color_list_installed_extra %>
40
+ <% end %>
41
+ <% if @config.color_list_installed_newer %>
42
+ color_list_installed_newer=<%= @config.color_list_installed_newer %>
43
+ <% end %>
44
+ <% if @config.color_list_installed_older %>
45
+ color_list_installed_older=<%= @config.color_list_installed_older %>
46
+ <% end %>
47
+ <% if @config.color_list_installed_reinstall %>
48
+ color_list_installed_reinstall=<%= @config.color_list_installed_reinstall %>
49
+ <% end %>
50
+ <% if @config.color_search_match %>
51
+ color_search_match=<%= @config.color_search_match %>
52
+ <% end %>
53
+ <% if @config.color_update_installed %>
54
+ color_update_installed=<%= @config.color_update_installed %>
55
+ <% end %>
56
+ <% if @config.color_update_local %>
57
+ color_update_local=<%= @config.color_update_local %>
58
+ <% end %>
59
+ <% if @config.color_update_remote %>
60
+ color_update_remote=<%= @config.color_update_remote %>
61
+ <% end %>
62
+ <% if @config.commands %>
63
+ commands=<%= @config.commands %>
64
+ <% end %>
65
+ <% if @config.debuglevel %>
66
+ debuglevel=<%= @config.debuglevel %>
67
+ <% end %>
68
+ <% if @config.deltarpm == true %>
69
+ deltarpm=1
70
+ <% elsif @config.deltarpm == false %>
71
+ deltarpm=0
72
+ <% end %>
73
+ <% if @config.diskspacecheck %>
74
+ diskspacecheck=<%= @config.diskspacecheck %>
75
+ <% end %>
76
+ <% if @config.distroverpkg %>
77
+ distroverpkg=<%= @config.distroverpkg %>
78
+ <% end %>
79
+ <% if @config.enable_group_conditionals %>
80
+ enable_group_conditionals=1
81
+ <% end %>
82
+ <% if @config.errorlevel %>
83
+ errorlevel=<%= @config.errorlevel %>
84
+ <% end %>
85
+ <% if @config.exactarch %>
86
+ exactarch=1
87
+ <% else %>
88
+ exactarch=0
89
+ <% end %>
90
+ <% if @config.exclude %>
91
+ exclude=<%= @config.exclude %>
92
+ <% end %>
93
+ <% if @config.gpgcheck %>
94
+ gpgcheck=1
95
+ <% else %>
96
+ gpgcheck=0
97
+ <% end %>
98
+ <% if @config.group_package_types %>
99
+ group_package_types=<%= @config.group_package_types %>
100
+ <% end %>
101
+ <% if @config.groupremove_leaf_only %>
102
+ groupremove_leaf_only=<%= @config.groupremove_leaf_only %>
103
+ <% end %>
104
+ <% if @config.history_list_view %>
105
+ history_list_view=<%= @config.history_list_view %>
106
+ <% end %>
107
+ <% if @config.history_record %>
108
+ history_record=<%= @config.history_record %>
109
+ <% end %>
110
+ <% if @config.history_record_packages %>
111
+ history_record_packages=<%= @config.history_record_packages %>
112
+ <% end %>
113
+ <% if @config.http_caching %>
114
+ http_caching=<%= @config.http_caching %>
115
+ <% end %>
116
+ <% if @config.installonly_limit %>
117
+ installonly_limit=<%= @config.installonly_limit %>
118
+ <% end %>
119
+ <% if @config.installonlypkgs %>
120
+ installonlypkgs=<%= @config.installonlypkgs %>
121
+ <% end %>
122
+ <% if @config.installroot %>
123
+ installroot=<%= @config.installroot %>
124
+ <% end %>
125
+ <% if @config.keepalive %>
126
+ keepalive=<%= @config.keepalive %>
127
+ <% end %>
128
+ <% if @config.keepcache %>
129
+ keepcache=1
130
+ <% else %>
131
+ keepcache=0
132
+ <% end %>
133
+ <% if @config.kernelpkgnames %>
134
+ kernelpkgnames=<%= @config.kernelpkgnames %>
135
+ <% end %>
136
+ <% if @config.localpkg_gpgcheck %>
137
+ localpkg_gpgcheck=1
138
+ <% else %>
139
+ localpkg_gpgcheck=0
140
+ <% end %>
141
+ <% if @config.logfile %>
142
+ logfile=<%= @config.logfile %>
143
+ <% end %>
144
+ <% if @config.max_retries %>
145
+ max_retries=<%= @config.max_retries %>
146
+ <% end %>
147
+ <% if @config.mdpolicy %>
148
+ mdpolicy=<%= @config.mdpolicy %>
149
+ <% end %>
150
+ <% if @config.metadata_expire %>
151
+ metadata_expire=<%= @config.metadata_expire %>
152
+ <% end %>
153
+ <% if @config.mirrorlist_expire %>
154
+ mirrorlist_expire=<%= @config.mirrorlist_expire %>
155
+ <% end %>
156
+ <% if @config.multilib_policy %>
157
+ multilib_policy=<%= @config.multilib_policy %>
158
+ <% end %>
159
+ <% if @config.obsoletes == false %>
160
+ obsoletes=0
161
+ <% else %>
162
+ obsoletes=1
163
+ <% end %>
164
+ <% if @config.overwrite_groups %>
165
+ overwrite_groups=<%= @config.overwrite_groups %>
166
+ <% end %>
167
+ <% if @config.password %>
168
+ password=<%= @config.password %>
169
+ <% end %>
170
+ <% if @config.persistdir %>
171
+ persistdir=<%= @config.persistdir %>
172
+ <% end %>
173
+ <% if @config.pluginconfpath %>
174
+ pluginconfpath=<%= @config.pluginconfpath %>
175
+ <% end %>
176
+ <% if @config.pluginpath %>
177
+ pluginpath=<%= @config.pluginpath %>
178
+ <% end %>
179
+ <% if @config.plugins %>
180
+ plugins=1
181
+ <% else %>
182
+ plugins=0
183
+ <% end %>
184
+ <% if @config.protected_multilib %>
185
+ protected_multilib=<%= @config.protected_multilib %>
186
+ <% end %>
187
+ <% if @config.protected_packages %>
188
+ protected_packages=<%= @config.protected_packages %>
189
+ <% end %>
190
+ <% if @config.proxy %>
191
+ proxy=<%= @config.proxy %>
192
+ <% end %>
193
+ <% if @config.proxy_password %>
194
+ proxy_password=<%= @config.proxy_password %>
195
+ <% end %>
196
+ <% if @config.proxy_username %>
197
+ proxy_username=<%= @config.proxy_username %>
198
+ <% end %>
199
+ <% if @config.recent %>
200
+ recent=<%= @config.recent %>
201
+ <% end %>
202
+ <% if @config.releasever %>
203
+ releasever=<%= @config.releasever %>
204
+ <% end %>
205
+ <% if @config.repo_gpgcheck %>
206
+ repo_gpgcheck=<%= @config.repo_gpgcheck %>
207
+ <% end %>
208
+ <% if @config.reposdir %>
209
+ reposdir=<%= @config.reposdir %>
210
+ <% end %>
211
+ <% if @config.reset_nice %>
212
+ reset_nice=<%= @config.reset_nice %>
213
+ <% end %>
214
+ <% if @config.rpmverbosity %>
215
+ rpmverbosity=<%= @config.rpmverbosity %>
216
+ <% end %>
217
+ <% if @config.showdupesfromrepos %>
218
+ showdupesfromrepos=<%= @config.showdupesfromrepos %>
219
+ <% end %>
220
+ <% if @config.skip_broken %>
221
+ skip_broken=<%= @config.skip_broken %>
222
+ <% end %>
223
+ <% if @config.ssl_check_cert_permissions %>
224
+ ssl_check_cert_permissions=<%= @config.ssl_check_cert_permissions %>
225
+ <% end %>
226
+ <% if @config.sslcacert %>
227
+ sslcacert=<%= @config.sslcacert %>
228
+ <% end %>
229
+ <% if @config.sslclientcert %>
230
+ sslclientcert=<%= @config.sslclientcert %>
231
+ <% end %>
232
+ <% if @config.sslclientkey %>
233
+ sslclientkey=<%= @config.sslclientkey %>
234
+ <% end %>
235
+ <% unless @config.sslverify.nil? %>
236
+ sslverify=<%= ( @config.sslverify ) ? 'true' : 'false' %>
237
+ <% end %>
238
+ <% if @config.syslog_device %>
239
+ syslog_device=<%= @config.syslog_device %>
240
+ <% end %>
241
+ <% if @config.syslog_facility %>
242
+ syslog_facility=<%= @config.syslog_facility %>
243
+ <% end %>
244
+ <% if @config.syslog_ident %>
245
+ syslog_ident=<%= @config.syslog_ident %>
246
+ <% end %>
247
+ <% if @config.throttle %>
248
+ throttle=<%= @config.throttle %>
249
+ <% end %>
250
+ <% if @config.timeout %>
251
+ timeout=<%= @config.timeout %>
252
+ <% end %>
253
+ <% if @config.tolerant %>
254
+ tolerant=<%= ( @config.tolerant ) ? '1' : '0' %>
255
+ <% end %>
256
+ <% if @config.tsflags %>
257
+ tsflags=<%= @config.tsflags %>
258
+ <% end %>
259
+ <% if @config.username %>
260
+ username=<%= @config.username %>
261
+ <% end %>
262
+ <% if @config.options -%>
263
+ <% @config.options.each do |key, value| -%>
264
+ <%= key %>=<%=
265
+ case value
266
+ when Array
267
+ value.join("\n ")
268
+ when TrueClass
269
+ '1'
270
+ when FalseClass
271
+ '0'
272
+ else
273
+ value
274
+ end %>
275
+ <% end -%>
276
+ <% end -%>