Permalink
Browse files

updated lots of cookbooks

  • Loading branch information...
1 parent 1691599 commit 71f6da334b8bc8d3df7c0c0c0a532b9e1e10e1ee @bryanwb committed Apr 11, 2012
Showing with 2,272 additions and 1,508 deletions.
  1. +1 −1 .gitignore
  2. +15 −14 ark/README.md
  3. +0 −112 ark/libraries/default.rb
  4. +0 −117 ark/libraries/provider_ark_base.rb
  5. +23 −8 ark/libraries/provider_ark_dump.rb
  6. +49 −2 ark/libraries/provider_ark_full.rb
  7. +0 −55 ark/libraries/provider_ark_pick_cherry.rb
  8. +1 −0 ark/libraries/provider_ark_put.rb
  9. +0 −199 ark/libraries/resource_ark_base.rb
  10. +3 −29 ark/libraries/resource_ark_dump.rb
  11. +30 −16 ark/libraries/resource_ark_full.rb
  12. +0 −76 ark/libraries/resource_ark_pick_cherry.rb
  13. +3 −1 ark/libraries/resource_ark_put.rb
  14. +1 −2 ark/metadata.rb
  15. +1 −26 ark/recipes/default.rb
  16. +57 −71 ark/recipes/test.rb
  17. +1 −0 chef_handler
  18. +4 −0 haproxy/attributes/default.rb
  19. +5 −5 haproxy/metadata.rb
  20. +87 −0 haproxy/recipes/source.rb
  21. +11 −0 java/CHANGELOG.md
  22. +29 −0 java/CONTRIBUTING
  23. +201 −0 java/LICENSE
  24. +25 −10 java/README.md
  25. +7 −7 java/attributes/default.rb
  26. +0 −50 java/metadata.json
  27. +1 −1 java/metadata.rb
  28. +11 −6 java/providers/ark.rb
  29. +0 −1 java/recipes/default.rb
  30. +1 −1 java/recipes/openjdk.rb
  31. +5 −0 java/recipes/oracle.rb
  32. +187 −0 java_old/README.md
  33. +52 −0 java_old/attributes/default.rb
  34. +16 −0 java_old/metadata.rb
  35. +158 −0 java_old/providers/ark.rb
  36. +22 −0 java_old/recipes/default.rb
  37. +83 −0 java_old/recipes/openjdk.rb
  38. +59 −0 java_old/recipes/oracle.rb
  39. +48 −0 java_old/recipes/oracle_i386.rb
  40. +37 −0 java_old/resources/ark.rb
  41. +8 −0 jboss/attributes/default.rb
  42. +1 −1 jboss/metadata.rb
  43. +4 −11 jboss/recipes/default.rb
  44. +65 −0 jboss/recipes/standalone.rb
  45. +1 −1 jboss/recipes/standalone_jdbc.rb
  46. +0 −8 jboss/spec/default_spec.rb
  47. +0 −8 jboss/spec/esb_spec.rb
  48. +0 −8 jboss/spec/jboss70_spec.rb
  49. +2 −0 jboss/templates/default/standalone.xml.erb
  50. +5 −6 jira/recipes/default.rb
  51. +2 −2 liferay/metadata.rb
  52. +52 −50 liferay/recipes/default.rb
  53. +3 −0 maven/CHANGELOG.md
  54. +29 −0 maven/CONTRIBUTING
  55. +201 −0 maven/LICENSE
  56. +1 −0 maven/README.md
  57. +5 −3 maven/attributes/default.rb
  58. +0 −50 maven/metadata.json
  59. +2 −1 maven/metadata.rb
  60. +5 −6 maven/providers/default.rb
  61. +3 −1 maven/recipes/default.rb
  62. +2 −4 maven/recipes/maven2.rb
  63. +6 −6 maven/recipes/maven3.rb
  64. +0 −22 maven/recipes/test.rb
  65. +1 −0 minitest-handler
  66. +1 −1 nagios/recipes/client_xinetd.rb
  67. +3 −3 pgbouncer/files/default/cron_userlist.sh
  68. +1 −0 pgbouncer/recipes/userlist.rb
  69. +0 −33 postgresql9/recipes/server.rb
  70. +18 −22 postgresql9/recipes/server_redhat.rb
  71. +1 −0 simple_cuke
  72. +9 −11 tomcat/templates/default/tomcat.init.el.erb
  73. +7 −0 users/CHANGELOG.md
  74. +29 −0 users/CONTRIBUTING
  75. +201 −0 users/LICENSE
  76. +48 −4 users/README.md
  77. +0 −37 users/metadata.json
  78. +1 −5 users/metadata.rb
  79. +104 −0 users/providers/manage.rb
  80. +88 −0 users/providers/manage_noid.rb
  81. +2 −25 users/recipes/artifactory.rb
  82. +2 −24 users/recipes/as.rb
  83. +2 −24 users/recipes/catalog.rb
  84. +2 −28 users/recipes/dam.rb
  85. +2 −27 users/recipes/geo.rb
  86. +2 −24 users/recipes/jboss.rb
  87. +2 −25 users/recipes/jenkins.rb
  88. +2 −25 users/recipes/jira.rb
  89. +2 −32 users/recipes/liferay.rb
  90. +2 −24 users/recipes/owlim.rb
  91. +2 −33 users/recipes/pentaho.rb
  92. +2 −28 users/recipes/postgres.rb
  93. +37 −0 users/recipes/sdmx.rb
  94. +2 −33 users/recipes/tcdr-sysadmins.rb
  95. +2 −40 users/recipes/tcdr.rb
  96. +31 −0 users/resources/manage.rb
  97. +30 −0 users/resources/manage_noid.rb
  98. +0 −1 users/root.rb
  99. +3 −1 users/templates/default/authorized_keys.erb
View
@@ -5,5 +5,5 @@ tmp/*
*.swo
*~
.#*
-ark
+ark/
metadata.json
View
@@ -5,8 +5,7 @@ An '''ark''' is like an archive but '''Kewler''
Does the fetch-unpack-configure-build-install dance. This is a
modified verion of Infochimps awesome install_from cookbook
- [http://github.com/infochimps-cookbooks/install_from](install_dir
- "/usr/local/share/tomcat/lib"). The main ark is fairly complex as it
+ [http://github.com/infochimps-cookbooks/install_from]. The main ark is fairly complex as it
encompasses a lot of functionality. Simpler LWRPs such as ark_put,
ark_dump, and ark_extract have been added.
@@ -18,9 +17,9 @@ the default :path of `/usr/local`, this provider will
* create a symlink for :home_dir (`/usr/local/pig`) pointing to :path
* add specified binary commands to the enviroment PATH variable
-By default, the ark will not run again if the :install_dir is not
-empty. You can specify a more granular condition by using :stop_file
-whose existence in :install_dir indicates that the ark has already
+By default, the ark will not run again if the :path is not
+empty. You can specify a more granular condition by using :creates
+whose existence in :path indicates that the ark has already
been unpacked. This is useful when you use several arks to deposit
libraries in a common directory like /usr/local/lib/ or /usr/local/share/tomcat/lib
@@ -79,9 +78,9 @@ NOTE: This currently only works for zip archives
- path: path to dump files to
- owner: owner of extracted directory, set to "root" by default
- mode: file mode for app_home, is an integer
-- stop_file: if you are appending files to a given directory, ark
+- creates: if you are appending files to a given directory, ark
needs a condition to test whether the file has already been
- extracted. You can specify a stop_file, a file whose existence
+ extracted. You can specify with creates, a file whose existence
indicates the ark has previously been extracted and does not need to
be extracted again
@@ -110,12 +109,11 @@ ark
download url from the apache mirrors site
- version: software version, required
- checksum: sha256 checksum, used for security
-- prefix_root: prefix_root for installation, defaults to /usr/local/
+- path: path for installation, defaults to /usr/local/<name>
- mode: file mode for app_home, is an integer TODO
-- install_dir: path to extract the ark to, by default is
- node['ark']['prefix_root']['prefix_install'] or /usr/local/share/<name>-<version>
-- home_dir: symbolic link to the install_dir
- node['ark']['prefix_root']['prefix_home'] or /usr/local/<name>
+- path: path to extract the ark to, by default is
+ or /usr/local/<name>-<version>
+- home_dir: symbolic link to the path /usr/local/<name>
- has_binaries: array of binary commands to symlink to
/usr/local/bin/, you must specify the relative path example: [ 'bin/java', 'bin/javaws' ]
- append_env_path: boolean, similar to has_binaries but less granular
@@ -124,6 +122,9 @@ ark
be added to the path. The commands are symbolically linked to
/usr/bin/* . Examples are mvn, java, javac, etc. This option
provides more granularity than the boolean option
+- autoconf_opts: an array of command line options for use with the GNU
+ autoconf script
+- make_opts: an array of command line options for use with make
- owner: owner of extracted directory, set to "root" by default
# Examples
@@ -178,13 +179,13 @@ the global PATH for all users. The user 'foobar' is the owner of the
# strip all directories and dump files into path specified by
- # the path attribute, you must specify the stop_file
+ # the path attribute, you must specify the `creates` attribute
# in order to keep the extraction from running every time
# the directory path will be created if it doesn't already exist
ark_dump "my_jars"
url "http://example.com/bunch_of_jars.zip"
path "/usr/local/tomcat/lib"
- stop_file "mysql.jar"
+ creates "mysql.jar"
owner "tomcat"
end
View
@@ -1,112 +0,0 @@
-#
-# Cookbook Name:: ark
-# Library:: default
-#
-# Author:: Bryan W. Berry <bryan.berry@gmail.com>
-# Copyright 2012, Bryan W. Berry
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-
-def parse_url(url)
- # construct the url if we use the auto-magic apache patterns
- unless url =~ /^(http|ftp).*$/
- url = set_apache_url(url)
- end
- # the url 'http://apache.org/pig/pig-0.8.0.tar.gz' has
- # release_basename 'pig-0.8.0' and release_ext 'tar.gz'
- release_basename, release_ext = parse_file_name(url)
- [ url, release_basename, release_ext ]
-end
-
-def set_ark_put_paths(path, name, release_ext)
- install_dir = ::File.join(path, "#{name}")
- release_file = ::File.join(install_dir, "#{name}.#{release_ext}")
- [ install_dir, release_file ]
-end
-
-def get_expand_cmd(release_ext)
- expand_cmd =
- case release_ext
- when 'tar.gz' then untar_cmd('xzf')
- when 'tar.bz2' then untar_cmd('xjf')
- when /zip|war|jar/ then unzip_cmd
- else raise "Don't know how to expand #{url} which has extension '#{release_ext}'"
- end
-end
-
-def parse_file_name(url)
- release_basename = ::File.basename(url.gsub(/\?.*\z/, '')).gsub(/-bin\b/, '')
- # (\?.*)? accounts for a trailing querystring
- release_basename =~ %r{^(.+?)\.(tar\.gz|tar\.bz2|zip|war|jar)(\?.*)?}
- release_ext = $2
- [release_basename, release_ext]
-end
-
-def unzip_cmd
- ::Proc.new {|r|
- FileUtils.mkdir_p r.install_dir
- if r.strip_leading_dir
- require 'tmpdir'
- tmpdir = Dir.mktmpdir
- system("unzip -q -u -o '#{r.release_file}' -d '#{tmpdir}'")
- subdirectory_children = Dir.glob("#{tmpdir}/**")
- FileUtils.mv subdirectory_children, r.install_dir
- FileUtils.rm_rf tmpdir
- elsif r.junk_paths
- system("unzip -q -u -o -j #{r.release_file} -d #{r.install_dir}")
- else
- system("unzip -q -u -o #{r.release_file} -d #{r.install_dir}")
- end
- FileUtils.chown_R r.owner, r.owner, r.install_dir
- }
-end
-
-def untar_cmd(sub_cmd)
- ::Proc.new {|r|
- FileUtils.mkdir_p r.install_dir
- if r.strip_leading_dir
- strip_argument = "--strip-components=1"
- else
- strip_argument = ""
- end
- system(%Q{tar '#{sub_cmd}' '#{r.release_file}' '#{strip_argument}' -C '#{r.install_dir}';})
- FileUtils.chown_R r.owner, r.owner, r.install_dir
- }
-end
-
-def ark_opened?(resource)
- if resource.stop_file and !(resource.stop_file.empty?)
- if ::File.exist?(::File.join(resource.install_dir,
- resource.stop_file))
- true
- else
- false
- end
- elsif !::File.exists?(resource.install_dir) or
- ::File.stat("#{resource.install_dir}/").nlink == 2
- Chef::Log.debug("ark is empty")
- false
- else
- true
- end
-end
-
-def set_apache_url(url)
- raise "Missing required resource attribute url" unless url
- url.gsub!(/:name:/, name.to_s)
- url.gsub!(/:version:/, version.to_s)
- url.gsub!(/:apache_mirror:/, node['install_from']['apache_mirror'])
- url
-end
@@ -1,117 +0,0 @@
-#
-# Cookbook Name:: ark
-# Provider:: ArkBase
-#
-# Author:: Bryan W. Berry <bryan.berry@gmail.com>
-# Copyright 2012, Bryan W. Berry
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-require 'chef/provider'
-
-class Chef
- class Provider
- class ArkBase < Chef::Provider
-
- def load_current_resource
- @current_resource = Chef::Resource::ArkBase.new(@new_resource.name)
- end
-
- def action_download
- run_context = Chef::RunContext.new(node, {})
- f = Chef::Resource::RemoteFile.new(new_resource.release_file, run_context)
- f.source new_resource.url
- if new_resource.checksum
- f.checksum new_resource.checksum
- end
- f.run_action(:create)
- end
-
- def action_install
- new_resource.set_paths
- unless exists?
- action_download
- action_unpack
- else
- Chef::Log.debug("Ark already exists")
- end
- action_set_owner
- action_install_binaries
- end
-
- def action_unpack
- run_context = Chef::RunContext.new(node, {})
- d = Chef::Resource::Directory.new(new_resource.path, run_context)
- d.mode '0755'
- d.recursive true
- d.run_action(:create)
- new_resource.expand_cmd.call(new_resource)
- end
-
- def action_set_owner
- require 'fileutils'
- FileUtils.chown_R new_resource.owner, new_resource.owner, new_resource.path
- end
-
- def action_install_binaries
- if not new_resource.has_binaries.empty?
- new_resource.has_binaries.each do |bin|
- file_name = ::File.join('/usr/local/bin', ::File.basename(bin))
- run_context = Chef::RunContext.new(node, {})
- l = Chef::Resource::Link.new(file_name, run_context)
-
- l.to ::File.join(new_resource.path, bin)
- l.run_action(:create)
- end
- elsif new_resource.append_env_path
- new_path = ::File.join(new_resource.path, 'bin')
- Chef::Log.debug("new_path is #{new_path}")
- run_context = Chef::RunContext.new(node, {})
- path = "/etc/profile.d/#{new_resource.name}.sh"
- f = Chef::Resource::File.new(path, run_context)
- f.content <<-EOF
- export PATH=$PATH:#{new_path}
- EOF
- f.mode 0755
- f.owner 'root'
- f.group 'root'
- f.run_action(:create)
- ENV['PATH'] = ENV['PATH'] + ':' + ::File.join(new_resource.path, 'bin')
- Chef::Log.debug("PATH after setting_path is #{ENV['PATH']}")
- end
- end
-
- private
-
- def exists?
- if new_resource.stop_file and !(new_resource.stop_file.empty?)
- if ::File.exist?(::File.join(new_resource.path,
- new_resource.stop_file))
- true
- else
- false
- end
- elsif !::File.exists?(new_resource.path) or
- ::File.stat("#{new_resource.path}/").nlink == 2
- false
- else
- true
- end
- end
-
-
- end
- end
-end
-
@@ -19,13 +19,14 @@
#
require 'chef/provider'
+require File.expand_path('provider_ark.rb', File.dirname(__FILE__))
class Chef
class Provider
class ArkDump < Chef::Provider::ArkBase
def action_install
- new_resource.set_paths
+ set_paths
unless exists?
action_download
action_unpack
@@ -39,15 +40,29 @@ def action_install
private
def exists?
- stop_file_path = ::File.join(new_resource.path,
- new_resource.stop_file)
- if new_resource.stop_file and ::File.exist?(stop_file_path)
- true
- else
- false
- end
+ creates_path = ::File.join(new_resource.path,
+ new_resource.creates)
+ new_resource.creates and ::File.exist?(creates_path)
end
+ def set_paths
+ release_ext = parse_file_extension
+ new_resource.release_file = ::File.join(Chef::Config[:file_cache_path],
+ "#{new_resource.name}.#{release_ext}")
+ end
+
+ def unzip_cmd
+ FileUtils.mkdir_p new_resource.path
+ cmd = Chef::ShellOut.new(%Q{unzip -j -q -u -o '#{new_resource.release_file}' -d '#{new_resource.path}'})
+ cmd.run_command
+ cmd.error!
+ end
+
+ def untar_cmd(sub_cmd)
+ Chef::Application.fatal!("Cannot yet dump paths for tar archives")
+ end
+
+
end
end
end
Oops, something went wrong.

0 comments on commit 71f6da3

Please sign in to comment.