├── files ├── info.php ├── index.html └── git-config ├── scripts ├── provision.sh ├── centos-common.sh ├── centos-database.sh ├── centos-web.sh └── centos-lamp.sh └── chef ├── supermarket ├── tomcat_latest │ ├── Gemfile │ ├── templates │ │ └── default │ │ │ ├── tomcat.erb │ │ │ ├── tomcat6.erb │ │ │ ├── tomcat7.erb │ │ │ ├── server7.xml.erb │ │ │ └── server6.xml.erb │ ├── CHANGELOG.md │ ├── metadata.rb │ ├── metadata.json │ ├── definitions │ │ └── default.rb │ ├── README.md │ ├── attributes │ │ └── default.rb │ ├── recipes │ │ └── default.rb │ └── LICENSE └── java │ ├── Berksfile │ ├── libraries │ ├── matchers.rb │ └── helpers.rb │ ├── templates │ └── default │ │ ├── oracle.jinfo.erb │ │ └── ibm_jdk.installer.properties.erb │ ├── .gitignore │ ├── Gemfile │ ├── CONTRIBUTING.md │ ├── recipes │ ├── purge_packages.rb │ ├── default_java_symlink.rb │ ├── default.rb │ ├── set_java_home.rb │ ├── ibm_tar.rb │ ├── oracle_i386.rb │ ├── openjdk.rb │ ├── oracle_rpm.rb │ ├── oracle.rb │ ├── ibm.rb │ ├── windows.rb │ └── set_attributes_from_version.rb │ ├── resources │ ├── alternatives.rb │ └── ark.rb │ ├── metadata.rb │ ├── TESTING.md │ ├── .kitchen.yml │ ├── providers │ ├── alternatives.rb │ └── ark.rb │ ├── attributes │ └── default.rb │ ├── LICENSE │ ├── CHANGELOG.md │ ├── README.md │ └── metadata.json ├── cookbooks └── vagrant_tomcat │ ├── README.md │ ├── attributes │ └── default.rb │ ├── metadata.rb │ ├── templates │ └── default │ │ ├── tomcat-users.xml.erb │ │ └── tomcat7.erb │ └── recipes │ └── default.rb └── roles └── tomcat7.rb /files/info.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /files/index.html: -------------------------------------------------------------------------------- 1 | 2 |

Hello From LAMP Shell Provisioner

3 | -------------------------------------------------------------------------------- /files/git-config: -------------------------------------------------------------------------------- 1 | [user] 2 | name = Jason Taylor 3 | email = jason@screencasts.pro 4 | -------------------------------------------------------------------------------- /scripts/provision.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Install Git and Nano 4 | yum install -y git 5 | yum install -y nano -------------------------------------------------------------------------------- /chef/supermarket/tomcat_latest/Gemfile: -------------------------------------------------------------------------------- 1 | source :rubygems 2 | 3 | gem 'berkshelf' 4 | gem 'vagrant', '~> 1.1.6' 5 | gem 'test-kitchen' 6 | -------------------------------------------------------------------------------- /chef/cookbooks/vagrant_tomcat/README.md: -------------------------------------------------------------------------------- 1 | # Vagrant Tomcat Cookbook 2 | 3 | ## Usage 4 | 5 | Include this cookbook, using the default recipe **vagrant_tomcat::default** 6 | -------------------------------------------------------------------------------- /scripts/centos-common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Update CentOS with any patches 4 | yum update -y --exclude=kernel 5 | 6 | # Tools 7 | yum install -y nano git unzip screen nc telnet -------------------------------------------------------------------------------- /chef/supermarket/java/Berksfile: -------------------------------------------------------------------------------- 1 | source "https://supermarket.getchef.com" 2 | metadata 3 | 4 | group :integration do 5 | cookbook 'apt', '~> 2.0' 6 | cookbook 'windows', '~> 1.12' 7 | end 8 | -------------------------------------------------------------------------------- /chef/supermarket/java/libraries/matchers.rb: -------------------------------------------------------------------------------- 1 | if defined?(ChefSpec) 2 | def set_java_alternatives(resource_name) 3 | ChefSpec::Matchers::ResourceMatcher.new(:java_alternatives, :set, resource_name) 4 | end 5 | end -------------------------------------------------------------------------------- /chef/supermarket/java/templates/default/oracle.jinfo.erb: -------------------------------------------------------------------------------- 1 | name=<%= @name %> 2 | priority=<%= @priority %> 3 | section=main 4 | 5 | <% @bin_cmds.each do |cmd| -%>jdk <%= cmd %> <%= @app_dir %>/bin/<%= cmd %> 6 | <% end -%> 7 | -------------------------------------------------------------------------------- /chef/supermarket/java/templates/default/ibm_jdk.installer.properties.erb: -------------------------------------------------------------------------------- 1 | INSTALLER_UI=silent 2 | USER_INSTALL_DIR=<%= node['java']['java_home'] %> 3 | -fileOverwrite_<%= node['java']['java_home'] %>_uninstall/uninstall.lax=Yes 4 | -------------------------------------------------------------------------------- /chef/roles/tomcat7.rb: -------------------------------------------------------------------------------- 1 | name "tomcat7" 2 | description "Installs all recipes needed for Java development deploying to Tomcat" 3 | run_list "recipe[java]","recipe[vagrant_tomcat]" 4 | default_attributes "java" => { "jdk_version" => "7" } 5 | -------------------------------------------------------------------------------- /scripts/centos-database.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # MySQL 4 | yum install -y mysql mysql-server mysql-devel 5 | chkconfig --add mysqld 6 | chkconfig mysqld on 7 | 8 | service mysqld start 9 | 10 | mysql -u root -e "SHOW DATABASES"; -------------------------------------------------------------------------------- /chef/supermarket/java/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *# 3 | .#* 4 | \#*# 5 | .*.sw[a-z] 6 | *.un~ 7 | *.tmp 8 | *.bk 9 | *.bkup 10 | .kitchen.local.yml 11 | Berksfile.lock 12 | Gemfile.lock 13 | 14 | .bundle/ 15 | .cache/ 16 | .kitchen/ 17 | .vagrant/ 18 | .vagrant.d/ 19 | bin/ 20 | tmp/ 21 | vendor/ 22 | -------------------------------------------------------------------------------- /chef/supermarket/java/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'berkshelf', '~> 2.0' 4 | gem 'chefspec', '~> 3.1' 5 | gem 'foodcritic', '~> 3.0' 6 | gem 'rubocop', '~> 0.12' 7 | 8 | group :integration do 9 | gem 'test-kitchen', '~> 1.2.1' 10 | gem 'kitchen-vagrant', '~> 0.14.0' 11 | end 12 | -------------------------------------------------------------------------------- /chef/cookbooks/vagrant_tomcat/attributes/default.rb: -------------------------------------------------------------------------------- 1 | default["tomcat_latest"]["tomcat_version"] = "7" 2 | default["tomcat_latest"]["tomcat_install_loc"] = "/usr/local" 3 | default["tomcat_latest"]["direct_download_version"] = "7.0.55" 4 | default["tomcat_latest"]["tomcat_user"] = "root" 5 | default["vagrant_tomcat"]["tomcat_home"] = "#{node["tomcat_latest"]["tomcat_install_loc"]}/tomcat/apache-tomcat" -------------------------------------------------------------------------------- /chef/supermarket/tomcat_latest/templates/default/tomcat.erb: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | export JAVA_OPTS=<%= node["tomcat_latest"]["java_options"] %> 3 | case "$1" in 4 | start) 5 | <%= node["tomcat_latest"]["tomcat_install_loc"] %>/tomcat/apache-tomcat/bin/startup.sh 6 | ;; 7 | stop) 8 | <%= node["tomcat_latest"]["tomcat_install_loc"] %>/tomcat/apache-tomcat/bin/shutdown.sh 9 | ;; 10 | *) 11 | echo "Syntax: $0 " 12 | esac 13 | -------------------------------------------------------------------------------- /chef/supermarket/tomcat_latest/templates/default/tomcat6.erb: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | export JAVA_OPTS=<%= node["tomcat_latest"]["java_options"] %> 3 | case "$1" in 4 | start) 5 | <%= node["tomcat_latest"]["tomcat_install_loc"] %>/tomcat6/apache-tomcat-6/bin/startup.sh 6 | ;; 7 | stop) 8 | <%= node["tomcat_latest"]["tomcat_install_loc"] %>/tomcat6/apache-tomcat-6/bin/shutdown.sh 9 | ;; 10 | *) 11 | echo "Syntax: $0 " 12 | esac 13 | -------------------------------------------------------------------------------- /chef/supermarket/tomcat_latest/templates/default/tomcat7.erb: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | export JAVA_OPTS=<%= node["tomcat_latest"]["java_options"] %> 3 | case "$1" in 4 | start) 5 | <%= node["tomcat_latest"]["tomcat_install_loc"] %>/tomcat7/apache-tomcat-7/bin/startup.sh 6 | ;; 7 | stop) 8 | <%= node["tomcat_latest"]["tomcat_install_loc"] %>/tomcat7/apache-tomcat-7/bin/shutdown.sh 9 | ;; 10 | *) 11 | echo "Syntax: $0 " 12 | esac 13 | -------------------------------------------------------------------------------- /chef/cookbooks/vagrant_tomcat/metadata.rb: -------------------------------------------------------------------------------- 1 | name 'vagrant_tomcat' 2 | maintainer 'Jason Taylor' 3 | maintainer_email 'jason@screencasts.pro' 4 | license 'Apache 2.0' 5 | description 'Customizes Tomcat-Latest Cookbook for Vagrant' 6 | long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) 7 | version '0.0.1' 8 | 9 | depends 'java' 10 | depends 'tomcat_latest' 11 | 12 | supports 'centos' 13 | 14 | recipe 'vagrant_tomcat::default', 'Updates Tomcat installation' -------------------------------------------------------------------------------- /chef/cookbooks/vagrant_tomcat/templates/default/tomcat-users.xml.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /chef/cookbooks/vagrant_tomcat/recipes/default.rb: -------------------------------------------------------------------------------- 1 | include_recipe "tomcat_latest" 2 | 3 | file "/etc/rc.d/tomcat" do 4 | action :delete 5 | end 6 | 7 | template "/etc/init.d/tomcat7" do 8 | source "tomcat7.erb" 9 | mode "0755" 10 | owner "root" 11 | group "root" 12 | notifies :restart, "service[tomcat7]" 13 | end 14 | 15 | template "#{node['vagrant_tomcat']['tomcat_home']}/conf/tomcat-users.xml" 16 | 17 | service "tomcat7" do 18 | service_name "tomcat7" 19 | supports :restart => true, :status => true 20 | action [:start, :enable] 21 | end -------------------------------------------------------------------------------- /chef/supermarket/tomcat_latest/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## v0.1.0: 2 | 3 | -Base line Version 4 | 5 | ## v0.1.1: 6 | 7 | -Supports centos and opensuse 12.1 8 | 9 | ## v0.1.2: 10 | 11 | -Supports fedora and install and configure specified version. 12 | 13 | ## v0.1.3: 14 | 15 | -Can specify the user to run tomcat as and bug fix on the version specification. 16 | 17 | ## v0.1.4: 18 | 19 | -Support for java_opts and Ubuntu 20 | 21 | ## v0.1.5: 22 | 23 | -Support for auto_start attribute and Debian Linux 24 | 25 | ## v0.1.6: 26 | 27 | -Bug fix: If the recipe is already installed do not download and install tomcat. -------------------------------------------------------------------------------- /scripts/centos-web.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Apache 4 | yum install -y httpd httpd-devel httpd-tools 5 | chkconfig --add httpd 6 | chkconfig httpd on 7 | service httpd stop 8 | 9 | rm -rf /var/www/html 10 | ln -s /vagrant /var/www/html 11 | 12 | service httpd start 13 | 14 | # PHP 15 | yum install -y php php-cli php-common php-devel php-mysql 16 | 17 | # Download Starter Content 18 | cd /vagrant 19 | sudo -u vagrant wget -q https://raw.githubusercontent.com/screencasts-pro/vagrant/master/files/index.html 20 | sudo -u vagrant wget -q https://raw.githubusercontent.com/screencasts-pro/vagrant/master/files/info.php 21 | 22 | service httpd restart -------------------------------------------------------------------------------- /chef/supermarket/tomcat_latest/metadata.rb: -------------------------------------------------------------------------------- 1 | name "tomcat_latest" 2 | maintainer "Chendil Kumar Manoharan" 3 | maintainer_email "mkchendil@gmail.com" 4 | license "Apache 2.0" 5 | description "Installs and Configures latest Apache Tomcat 6 or 7 or specified version" 6 | long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) 7 | version "0.1.6" 8 | 9 | %w{ java }.each do |cb| 10 | depends cb 11 | end 12 | 13 | %w{ suse centos fedora ubuntu debian}.each do |os| 14 | supports os 15 | end 16 | 17 | recipe "tomcat::default", "Installs and Configures latest Apache Tomcat 6 or 7 or specified version" -------------------------------------------------------------------------------- /chef/supermarket/java/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing 2 | ============ 3 | 1. Fork it 4 | 2. Create your feature branch (`git checkout -b my-new-feature`) 5 | 3. Commit your changes (`git commit -am 'Add some feature'`) 6 | 4. [**Add tests!**](https://github.com/agileorbit-cookbooks/java/blob/master/TESTING.md) 7 | 5. Push to the branch (`git push origin my-new-feature`) 8 | 6. Create new Pull Request 9 | 10 | As this cookbook is no longer maintained by Chef, you **do not** need to sign any sort of contributor agreement. Simply make your change and open a pull request. 11 | 12 | Contributions will only be accepted if they are fully tested as specified in [TESTING.md](https://github.com/agileorbit-cookbooks/java/blob/master/TESTING.md) 13 | -------------------------------------------------------------------------------- /chef/supermarket/java/recipes/purge_packages.rb: -------------------------------------------------------------------------------- 1 | # Cookbook Name:: java 2 | # Recipe:: purge_packages 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | %w[sun-java6-jdk sun-java6-bin sun-java6-jre].each do |pkg| 17 | package pkg do 18 | action :purge 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /chef/supermarket/java/recipes/default_java_symlink.rb: -------------------------------------------------------------------------------- 1 | # Cookbook Name:: java 2 | # Recipe:: default_java_symlink 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | link '/usr/lib/jvm/default-java' do 17 | to node['java']['java_home'] 18 | not_if { node['java']['java_home'] == '/usr/lib/jvm/default-java' } 19 | end 20 | -------------------------------------------------------------------------------- /scripts/centos-lamp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Update CentOS with any patches 4 | yum update -y --exclude=kernel 5 | 6 | # Tools 7 | yum install -y nano git unzip screen 8 | 9 | # Apache 10 | yum install -y httpd httpd-devel httpd-tools 11 | chkconfig --add httpd 12 | chkconfig httpd on 13 | service httpd stop 14 | 15 | rm -rf /var/www/html 16 | ln -s /vagrant /var/www/html 17 | 18 | service httpd start 19 | 20 | # PHP 21 | yum install -y php php-cli php-common php-devel php-mysql 22 | 23 | # MySQL 24 | yum install -y mysql mysql-server mysql-devel 25 | chkconfig --add mysqld 26 | chkconfig mysqld on 27 | 28 | service mysqld start 29 | 30 | mysql -u root -e "SHOW DATABASES"; 31 | 32 | # Download Starter Content 33 | cd /vagrant 34 | sudo -u vagrant wget -q https://raw.githubusercontent.com/screencasts-pro/vagrant/master/files/index.html 35 | sudo -u vagrant wget -q https://raw.githubusercontent.com/screencasts-pro/vagrant/master/files/info.php 36 | 37 | service httpd restart -------------------------------------------------------------------------------- /chef/supermarket/tomcat_latest/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tomcat_latest", 3 | "description": "Installs and Configures latest Apache Tomcat 6 or 7", 4 | "long_description": "Description\n===========\n\nInstalls and configures latest Apache Tomcat version 6 or 7 or specified version", 5 | "maintainer": "Chendil Kumar Manoharan", 6 | "maintainer_email": "mkchendil@gmail.com", 7 | "license": "Apache 2.0", 8 | "platforms": { 9 | "suse": ">= 0.0.0", 10 | "centos": ">=0.0.0", 11 | "fedora": ">=0.0.0", 12 | "ubuntu": ">=0.0.0", 13 | "debian": ">=0.0.0" 14 | }, 15 | "dependencies": { 16 | "java": ">= 0.0.0" 17 | }, 18 | "recommendations": { 19 | }, 20 | "suggestions": { 21 | }, 22 | "conflicting": { 23 | }, 24 | "providing": { 25 | }, 26 | "replacing": { 27 | }, 28 | "attributes": { 29 | }, 30 | "groupings": { 31 | }, 32 | "recipes": { 33 | "tomcat::default": "Installs and Configures latest Apache Tomcat 6 or 7 or specified version" 34 | }, 35 | "version": "0.1.6" 36 | } -------------------------------------------------------------------------------- /chef/cookbooks/vagrant_tomcat/templates/default/tomcat7.erb: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Tomcat7: Start/Stop Tomcat 7 3 | # 4 | # chkconfig: - 90 10 5 | # description: Tomcat is a Java application Server. 6 | 7 | . /etc/init.d/functions 8 | . /etc/sysconfig/network 9 | 10 | CATALINA_HOME=<%= node["vagrant_tomcat"]["tomcat_home"] %> 11 | TOMCAT_USER=root 12 | LOCKFILE=/var/lock/subsys/tomcat 13 | 14 | RETVAL=0 15 | start(){ 16 | echo "Starting Tomcat7: " 17 | su - $TOMCAT_USER -c "$CATALINA_HOME/bin/startup.sh" 18 | RETVAL=$? 19 | echo 20 | [ $RETVAL -eq 0 ] && touch $LOCKFILE 21 | return $RETVAL 22 | } 23 | 24 | stop(){ 25 | echo "Shutting down Tomcat7: " 26 | $CATALINA_HOME/bin/shutdown.sh 27 | RETVAL=$? 28 | echo 29 | [ $RETVAL -eq 0 ] && rm -f $LOCKFILE 30 | return $RETVAL 31 | } 32 | 33 | case "$1" in 34 | start) 35 | start 36 | ;; 37 | stop) 38 | stop 39 | ;; 40 | restart) 41 | stop 42 | start 43 | ;; 44 | status) 45 | status tomcat 46 | ;; 47 | *) 48 | echo $"Usage: $0 {start|stop|restart|status}" 49 | exit 1 50 | ;; 51 | esac 52 | exit $? -------------------------------------------------------------------------------- /chef/supermarket/java/recipes/default.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Author:: Seth Chisamore () 3 | # Cookbook Name:: java 4 | # Recipe:: default 5 | # 6 | # Copyright 2008-2011, Opscode, Inc. 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 | if node['java']['install_flavor'] != 'windows' 22 | if node['java']['jdk_version'].to_i == 8 and node['java']['install_flavor'] != 'oracle' 23 | Chef::Application.fatal!("JDK 8 is currently only provided with the Oracle JDK") 24 | end 25 | end 26 | 27 | include_recipe "java::set_attributes_from_version" 28 | include_recipe "java::#{node['java']['install_flavor']}" 29 | -------------------------------------------------------------------------------- /chef/supermarket/java/resources/alternatives.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: java 3 | # Provider:: alternatives 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | actions :set, :unset 18 | 19 | attribute :java_location, :kind_of => String, :default => nil 20 | attribute :bin_cmds, :kind_of => Array, :default => nil 21 | attribute :default, :equal_to => [true, false], :default => true 22 | attribute :priority, :kind_of => Integer, :default => 1061 23 | 24 | # we have to set default for the supports attribute 25 | # in initializer since it is a 'reserved' attribute name 26 | def initialize(*args) 27 | super 28 | @action = :set 29 | end 30 | -------------------------------------------------------------------------------- /chef/supermarket/java/metadata.rb: -------------------------------------------------------------------------------- 1 | name "java" 2 | maintainer "Agile Orbit" 3 | maintainer_email "info@agileorbit.com" 4 | license "Apache 2.0" 5 | description "Installs Java runtime." 6 | long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) 7 | version "1.25.0" 8 | 9 | recipe "java::default", "Installs Java runtime" 10 | recipe "java::default_java_symlink", "Updates /usr/lib/jvm/default-java" 11 | recipe "java::ibm", "Installs the JDK for IBM" 12 | recipe "java::ibm_tar", "Installs the JDK for IBM from a tarball" 13 | recipe "java::openjdk", "Installs the OpenJDK flavor of Java" 14 | recipe "java::oracle", "Installs the Oracle flavor of Java" 15 | recipe "java::oracle_i386", "Installs the 32-bit jvm without setting it as the default" 16 | recipe "java::oracle_rpm", "Installs the Oracle RPM flavor of Java" 17 | recipe "java::purge_packages", "Purges old Sun JDK packages" 18 | recipe "java::set_attributes_from_version", "Sets various attributes that depend on jdk_version" 19 | recipe "java::set_java_home", "Sets the JAVA_HOME environment variable" 20 | recipe "java::windows", "Installs the JDK on Windows" 21 | 22 | %w{ 23 | debian 24 | ubuntu 25 | centos 26 | redhat 27 | scientific 28 | fedora 29 | amazon 30 | arch 31 | oracle 32 | freebsd 33 | windows 34 | suse 35 | xenserver 36 | smartos 37 | }.each do |os| 38 | supports os 39 | end 40 | 41 | suggests "windows" 42 | suggests "aws" 43 | -------------------------------------------------------------------------------- /chef/supermarket/tomcat_latest/definitions/default.rb: -------------------------------------------------------------------------------- 1 | 2 | define :unzip_tomcat6or7, :enable => true do 3 | 4 | if params[:name]=="6" 5 | execute "Unzip Apache Tomcat 6 binary file" do 6 | user "#{node[:tomcat_latest][:tomcat_user]}" 7 | installation_dir = "/tmp" 8 | cwd installation_dir 9 | command "tar zxvf /tmp/apache-tomcat-6.*.tar.gz -C #{node[:tomcat_latest][:tomcat_install_loc]}/tomcat6" 10 | action :run 11 | end 12 | end 13 | 14 | if params[:name]=="7" 15 | execute "Unzip Apache Tomcat 7 binary file" do 16 | user "#{node[:tomcat_latest][:tomcat_user]}" 17 | installation_dir = "/tmp" 18 | cwd installation_dir 19 | command "tar zxvf /tmp/apache-tomcat-7.*.tar.gz -C #{node[:tomcat_latest][:tomcat_install_loc]}/tomcat7" 20 | action :run 21 | end 22 | end 23 | 24 | if params[:name]=="d" 25 | 26 | execute "Unzip Apache Tomcat binary file" do 27 | user "#{node[:tomcat_latest][:tomcat_user]}" 28 | installation_dir = "/tmp" 29 | cwd installation_dir 30 | command "tar zxvf /tmp/apache-tomcat-* -C #{node[:tomcat_latest][:tomcat_install_loc]}/tomcat" 31 | action :run 32 | end 33 | 34 | end 35 | 36 | 37 | end 38 | 39 | 40 | define :template6or7, :user => "vagrant" do 41 | if params[:name]=="6" 42 | template "/etc/rc.d/tomcat6" do 43 | source "tomcat6.erb" 44 | owner params[:enable] 45 | mode "0755" 46 | end 47 | end 48 | 49 | if params[:name]=="7" 50 | template "/etc/rc.d/tomcat7" do 51 | source "tomcat7.erb" 52 | owner params[:user] 53 | mode "0755" 54 | end 55 | end 56 | 57 | end -------------------------------------------------------------------------------- /chef/supermarket/java/recipes/set_java_home.rb: -------------------------------------------------------------------------------- 1 | # Author:: Joshua Timberman () 2 | # Cookbook Name:: java 3 | # Recipe:: set_java_home 4 | # 5 | # Copyright 2013, Opscode, Inc. 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 | ruby_block "set-env-java-home" do 20 | block do 21 | ENV["JAVA_HOME"] = node['java']['java_home'] 22 | end 23 | not_if { ENV["JAVA_HOME"] == node['java']['java_home'] } 24 | end 25 | 26 | directory "/etc/profile.d" do 27 | mode 00755 28 | end 29 | 30 | file "/etc/profile.d/jdk.sh" do 31 | content "export JAVA_HOME=#{node['java']['java_home']}" 32 | mode 00755 33 | end 34 | 35 | if node['java']['set_etc_environment'] 36 | ruby_block "Set JAVA_HOME in /etc/environment" do 37 | block do 38 | file = Chef::Util::FileEdit.new("/etc/environment") 39 | file.insert_line_if_no_match(/^JAVA_HOME=/, "JAVA_HOME=#{node['java']['java_home']}") 40 | file.search_file_replace_line(/^JAVA_HOME=/, "JAVA_HOME=#{node['java']['java_home']}") 41 | file.write_file 42 | end 43 | end 44 | end 45 | -------------------------------------------------------------------------------- /chef/supermarket/java/TESTING.md: -------------------------------------------------------------------------------- 1 | Testing the java cookbook 2 | ===== 3 | 4 | This cookbook includes both unit tests via [ChefSpec](https://github.com/sethvargo/chefspec) and integration tests via [Test Kitchen](https://github.com/test-kitchen/test-kitchen). Contributions to this cookbook will only be accepted if all tests pass successfully: 5 | 6 | ```bash 7 | kitchen test 8 | chef exec rspec 9 | ``` 10 | 11 | Setting up the test environment 12 | ----- 13 | 14 | Install the latest version of [Vagrant](http://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads) (free) or [VMWare Fusion](http://www.vmware.com/products/fusion) (paid). 15 | 16 | The Chef tooling (chefspec/test kitchen/etc) is managed by the [Chef Development Kit](http://downloads.getchef.com/chef-dk/) - Version 0.2.0-2. 17 | 18 | Clone the latest version of the cookbook from the repository. 19 | 20 | ```bash 21 | git clone git@github.com:agileorbit-cookbooks/java.git 22 | cd java 23 | ``` 24 | 25 | Running ChefSpec 26 | ----- 27 | 28 | ChefSpec unit tests are located in `spec`. Each recipe has a `recipename_spec.rb` file that contains unit tests for that recipe. Your new functionality or bug fix should have corresponding test coverage - if it's a change, make sure it doesn't introduce a regression (existing tests should pass). If it's a change or introduction of new functionality, add new tests as appropriate. 29 | 30 | To run ChefSpec for the whole cookbook: 31 | 32 | `chef exec rspec` 33 | 34 | To run ChefSpec for a specific recipe: 35 | 36 | `chef exec rspec spec/set_java_home_spec.rb` 37 | 38 | Running Test Kitchen 39 | ----- 40 | 41 | Test Kitchen test suites are defined in [.kitchen.yml](https://github.com/agileorbit-cookbooks/java/blob/master/.kitchen.yml). Running `kitchen test` will cause Test Kitchen to spin up each platform VM in turn, running the `java::default` recipe with differing parameters in order to test all possible combinations of platform, install_flavor, and JDK version. If the Chef run completes successfully, corresponding tests in `test/integration` are executed. These must also pass. 42 | -------------------------------------------------------------------------------- /chef/supermarket/java/resources/ark.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Author:: Bryan W. Berry () 3 | # Cookbook Name:: java 4 | # Resource:: ark 5 | # 6 | # Copyright 2011, Bryan w. Berry 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 | actions :install, :remove 21 | 22 | state_attrs :alternatives_priority, 23 | :app_home, 24 | :app_home_mode, 25 | :bin_cmds, 26 | :checksum, 27 | :md5, 28 | :default, 29 | :mirrorlist, 30 | :owner, 31 | :url 32 | 33 | attribute :url, :regex => /^(file|http|https?):\/\/.*(gz|tar.gz|tgz|bin|zip)$/, :default => nil 34 | attribute :mirrorlist, :kind_of => Array, :default => nil 35 | attribute :checksum, :regex => /^[0-9a-f]{32}$|^[a-zA-Z0-9]{40,64}$/, :default => nil 36 | attribute :md5, :regex => /^[0-9a-f]{32}$|^[a-zA-Z0-9]{40,64}$/, :default => nil 37 | attribute :app_home, :kind_of => String, :default => nil 38 | attribute :app_home_mode, :kind_of => Integer, :default => 0755 39 | attribute :bin_cmds, :kind_of => Array, :default => [] 40 | attribute :owner, :default => "root" 41 | attribute :default, :equal_to => [true, false], :default => true 42 | attribute :alternatives_priority, :kind_of => Integer, :default => 1 43 | attribute :retries, :kind_of => Integer, :default => 0 44 | attribute :retry_delay, :kind_of => Integer, :default => 2 45 | 46 | # we have to set default for the supports attribute 47 | # in initializer since it is a 'reserved' attribute name 48 | def initialize(*args) 49 | super 50 | @action = :install 51 | @supports = {:report => true, :exception => true} 52 | end 53 | -------------------------------------------------------------------------------- /chef/supermarket/tomcat_latest/README.md: -------------------------------------------------------------------------------- 1 | Description 2 | =========== 3 | 4 | Installs and configures latest Apache Tomcat version 6 or 7 or specified version. 5 | 6 | Requirements 7 | ============ 8 | 9 | Platform: 10 | 11 | * Suse, CentOS, Fedora, Ubuntu, Debian 12 | 13 | The following Opscode cookbooks are dependencies: 14 | 15 | * java 16 | 17 | Attributes 18 | ========== 19 | 20 | * `node['tomcat_latest']['tomcat_version']` - The tomcat version to be installed, default `7` 21 | * `node["tomcat_latest"]["port"]` - The network port used by Tomcat's HTTP connector, default `8080`. 22 | * `node["tomcat_latest"]["ssl_port"]` - The network port used by Tomcat's SSL HTTP connector, default `8443`. 23 | * `node["tomcat_latest"]["ajp_port"]` - The network port used by Tomcat's AJP connector, default `8009`. 24 | * `node['tomcat_latest']['tomcat_install_loc']` - The tomcat install location, default `/tmp/apache` 25 | * `node['tomcat_latest']['direct_download_version']` - Specify the tomcat version to download. Eg: 7.0.35, default `na` 26 | * `node['tomcat_latest']['tomcat_user']` = Specify the user that tomcat will run as. default `root` 27 | * `node['tomcat_latest']['java_options']` = Specify the JAVA_OPTS. default `Xmx128M` 28 | * `node['tomcat_latest']['auto_start']` = Indicate whether to start the tomcat after installing the recipe. default `true` 29 | 30 | 31 | Usage 32 | ===== 33 | 34 | Simply include the recipe where you want Tomcat installed. 35 | 36 | License and Author 37 | ================== 38 | 39 | Author:: Chendil Kumar Manoharan () 40 | Copyright:: 2013, Chendil Kumar 41 | 42 | Licensed under the Apache License, Version 2.0 (the "License"); 43 | you may not use this file except in compliance with the License. 44 | You may obtain a copy of the License at 45 | 46 | http://www.apache.org/licenses/LICENSE-2.0 47 | 48 | Unless required by applicable law or agreed to in writing, software 49 | distributed under the License is distributed on an "AS IS" BASIS, 50 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 51 | See the License for the specific language governing permissions and 52 | limitations under the License. 53 | -------------------------------------------------------------------------------- /chef/supermarket/java/recipes/ibm_tar.rb: -------------------------------------------------------------------------------- 1 | # Cookbook Name:: java 2 | # Recipe:: ibm_tar 3 | # 4 | # Copyright 2013, Opscode, Inc. 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 | require 'uri' 19 | 20 | source_url = node['java']['ibm']['url'] 21 | jdk_uri = ::URI.parse(source_url) 22 | jdk_filename = ::File.basename(jdk_uri.path) 23 | 24 | unless valid_ibm_jdk_uri?(source_url) 25 | raise "You must set the attribute `node['java']['ibm']['url']` to a valid URI" 26 | end 27 | 28 | unless jdk_filename =~ /\.(tar.gz|tgz)$/ 29 | raise "The attribute `node['java']['ibm']['url']` must specify a .tar.gz file" 30 | end 31 | 32 | remote_file "#{Chef::Config[:file_cache_path]}/#{jdk_filename}" do 33 | source source_url 34 | mode 00755 35 | if node['java']['ibm']['checksum'] 36 | checksum node['java']['ibm']['checksum'] 37 | action :create 38 | else 39 | action :create_if_missing 40 | end 41 | notifies :create, "directory[create-java-home]", :immediately 42 | notifies :run, "execute[untar-ibm-java]", :immediately 43 | end 44 | 45 | directory "create-java-home" do 46 | path node['java']['java_home'] 47 | mode 00755 48 | recursive true 49 | end 50 | 51 | java_alternatives 'set-java-alternatives' do 52 | java_location node['java']['java_home'] 53 | default node['java']['set_default'] 54 | case node['java']['jdk_version'].to_s 55 | when "6" 56 | bin_cmds node['java']['ibm']['6']['bin_cmds'] 57 | when "7" 58 | bin_cmds node['java']['ibm']['7']['bin_cmds'] 59 | end 60 | action :nothing 61 | end 62 | 63 | execute "untar-ibm-java" do 64 | cwd Chef::Config[:file_cache_path] 65 | command "tar xzf ./#{jdk_filename} -C #{node['java']['java_home']} --strip 1" 66 | notifies :set, 'java_alternatives[set-java-alternatives]', :immediately 67 | creates "#{node['java']['java_home']}/jre/bin/java" 68 | end 69 | 70 | include_recipe "java::set_java_home" 71 | -------------------------------------------------------------------------------- /chef/supermarket/java/recipes/oracle_i386.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Author:: Bryan W. Berry () 3 | # Cookbook Name:: java 4 | # Recipe:: oracle_i386 5 | # 6 | # Copyright 2010-2011, Opscode, Inc. 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 | unless node.recipe?('java::default') 21 | Chef::Log.warn("Using java::default instead is recommended.") 22 | 23 | # Even if this recipe is included by itself, a safety check is nice... 24 | if node['java']['java_home'].nil? or node['java']['java_home'].empty? 25 | include_recipe "java::set_attributes_from_version" 26 | end 27 | end 28 | 29 | java_home = node['java']["java_home"] 30 | 31 | case node['java']['jdk_version'].to_s 32 | when "6" 33 | tarball_url = node['java']['jdk']['6']['i586']['url'] 34 | tarball_checksum = node['java']['jdk']['6']['i586']['checksum'] 35 | bin_cmds = node['java']['jdk']['6']['bin_cmds'] 36 | when "7" 37 | tarball_url = node['java']['jdk']['7']['i586']['url'] 38 | tarball_checksum = node['java']['jdk']['7']['i586']['checksum'] 39 | bin_cmds = node['java']['jdk']['7']['bin_cmds'] 40 | when "8" 41 | tarball_url = node['java']['jdk']['8']['i586']['url'] 42 | tarball_checksum = node['java']['jdk']['8']['i586']['checksum'] 43 | bin_cmds = node['java']['jdk']['8']['bin_cmds'] 44 | end 45 | 46 | include_recipe "java::set_java_home" 47 | 48 | yum_package "glibc" do 49 | arch "i686" 50 | only_if { platform_family?( "rhel", "fedora" ) } 51 | end 52 | 53 | java_ark "jdk-alt" do 54 | url tarball_url 55 | default node['java']['set_default'] 56 | checksum tarball_checksum 57 | app_home java_home 58 | bin_cmds bin_cmds 59 | retries node['java']['ark_retries'] 60 | retry_delay node['java']['ark_retries'] 61 | action :install 62 | default false 63 | end 64 | 65 | if node['java']['set_default'] and platform_family?('debian') 66 | include_recipe 'java::default_java_symlink' 67 | end 68 | -------------------------------------------------------------------------------- /chef/supermarket/java/recipes/openjdk.rb: -------------------------------------------------------------------------------- 1 | # Author:: Bryan W. Berry () 2 | # Author:: Seth Chisamore () 3 | # Author:: Joshua Timberman () 4 | # 5 | # Cookbook Name:: java 6 | # Recipe:: openjdk 7 | # 8 | # Copyright 2010-2013, Opscode, Inc. 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 | unless node.recipe?('java::default') 23 | Chef::Log.warn("Using java::default instead is recommended.") 24 | 25 | # Even if this recipe is included by itself, a safety check is nice... 26 | [ node['java']['openjdk_packages'], node['java']['java_home'] ].each do |v| 27 | if v.nil? or v.empty? 28 | include_recipe "java::set_attributes_from_version" 29 | end 30 | end 31 | end 32 | 33 | jdk = Opscode::OpenJDK.new(node) 34 | 35 | if platform_requires_license_acceptance? 36 | file "/opt/local/.dlj_license_accepted" do 37 | owner "root" 38 | group "root" 39 | mode "0400" 40 | action :create 41 | only_if { node['java']['accept_license_agreement'] } 42 | end 43 | end 44 | 45 | node['java']['openjdk_packages'].each do |pkg| 46 | package pkg 47 | end 48 | 49 | if platform_family?('debian', 'rhel', 'fedora') 50 | java_alternatives 'set-java-alternatives' do 51 | java_location jdk.java_home 52 | default node['java']['set_default'] 53 | priority jdk.alternatives_priority 54 | case node['java']['jdk_version'].to_s 55 | when "6" 56 | bin_cmds node['java']['jdk']['6']['bin_cmds'] 57 | when "7" 58 | bin_cmds node['java']['jdk']['7']['bin_cmds'] 59 | end 60 | action :set 61 | end 62 | end 63 | 64 | if node['java']['set_default'] and platform_family?('debian') 65 | include_recipe 'java::default_java_symlink' 66 | end 67 | 68 | # We must include this recipe AFTER updating the alternatives or else JAVA_HOME 69 | # will not point to the correct java. 70 | include_recipe 'java::set_java_home' 71 | -------------------------------------------------------------------------------- /chef/supermarket/java/recipes/oracle_rpm.rb: -------------------------------------------------------------------------------- 1 | # Author:: Christophe Arguel () 2 | # 3 | # Cookbook Name:: java 4 | # Recipe:: oracle_rpm 5 | # 6 | # Copyright 2013, Christophe Arguel 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 | include_recipe 'java::set_java_home' 21 | 22 | 23 | slave_cmds = case node['java']['oracle_rpm']['type'] 24 | when 'jdk' 25 | %W[appletviewer apt ControlPanel extcheck idlj jar jarsigner javac javadoc javafxpackager javah javap java-rmi.cgi javaws jcmd jconsole jcontrol jdb jhat jinfo jmap jps jrunscript jsadebugd jstack jstat jstatd jvisualvm keytool native2ascii orbd pack200 policytool rmic rmid rmiregistry schemagen serialver servertool tnameserv unpack200 wsgen wsimport xjc] 26 | 27 | when 'jre' 28 | %W[ControlPanel java_vm javaws jcontrol keytool orbd pack200 policytool rmid rmiregistry servertool tnameserv unpack200] 29 | 30 | else 31 | Chef::Application.fatal "Unsupported oracle RPM type (#{node['java']['oracle_rpm']['type']})" 32 | end 33 | 34 | if platform_family?('rhel', 'fedora') and node['java']['set_default'] 35 | 36 | bash 'update-java-alternatives' do 37 | java_home = node['java']['java_home'] 38 | java_location = File.join(java_home, "bin", "java") 39 | slave_lines = slave_cmds.inject("") do |slaves, cmd| 40 | slaves << "--slave /usr/bin/#{cmd} #{cmd} #{File.join(java_home, "bin", cmd)} \\\n" 41 | end 42 | 43 | code <<-EOH.gsub(/^\s+/, '') 44 | update-alternatives --install /usr/bin/java java #{java_location} 1061 \ 45 | #{slave_lines} && \ 46 | update-alternatives --set java #{java_location} 47 | EOH 48 | action :nothing 49 | end 50 | 51 | end 52 | 53 | package node['java']['oracle_rpm']['type'] do 54 | action :upgrade 55 | notifies :run, 'bash[update-java-alternatives]', :immediately if platform_family?('rhel', 'fedora') and node['java']['set_default'] 56 | end 57 | -------------------------------------------------------------------------------- /chef/supermarket/java/recipes/oracle.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Author:: Bryan W. Berry () 3 | # Cookbook Name:: java 4 | # Recipe:: oracle 5 | # 6 | # Copyright 2011, Bryan w. Berry 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 | unless node.recipe?('java::default') 21 | Chef::Log.warn("Using java::default instead is recommended.") 22 | 23 | # Even if this recipe is included by itself, a safety check is nice... 24 | if node['java']['java_home'].nil? or node['java']['java_home'].empty? 25 | include_recipe "java::set_attributes_from_version" 26 | end 27 | end 28 | 29 | java_home = node['java']["java_home"] 30 | arch = node['java']['arch'] 31 | 32 | case node['java']['jdk_version'].to_s 33 | when "6" 34 | tarball_url = node['java']['jdk']['6'][arch]['url'] 35 | tarball_checksum = node['java']['jdk']['6'][arch]['checksum'] 36 | bin_cmds = node['java']['jdk']['6']['bin_cmds'] 37 | when "7" 38 | tarball_url = node['java']['jdk']['7'][arch]['url'] 39 | tarball_checksum = node['java']['jdk']['7'][arch]['checksum'] 40 | bin_cmds = node['java']['jdk']['7']['bin_cmds'] 41 | when "8" 42 | tarball_url = node['java']['jdk']['8'][arch]['url'] 43 | tarball_checksum = node['java']['jdk']['8'][arch]['checksum'] 44 | bin_cmds = node['java']['jdk']['8']['bin_cmds'] 45 | end 46 | 47 | if tarball_url =~ /example.com/ 48 | Chef::Application.fatal!("You must change the download link to your private repository. You can no longer download java directly from http://download.oracle.com without a web broswer") 49 | end 50 | 51 | include_recipe "java::set_java_home" 52 | 53 | java_ark "jdk" do 54 | url tarball_url 55 | default node['java']['set_default'] 56 | checksum tarball_checksum 57 | app_home java_home 58 | bin_cmds bin_cmds 59 | alternatives_priority node['java']['alternatives_priority'] 60 | retries node['java']['ark_retries'] 61 | retry_delay node['java']['ark_retry_delay'] 62 | action :install 63 | end 64 | 65 | if node['java']['set_default'] and platform_family?('debian') 66 | include_recipe 'java::default_java_symlink' 67 | end 68 | -------------------------------------------------------------------------------- /chef/supermarket/tomcat_latest/attributes/default.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: tomcat_latest 3 | # Attributes:: default 4 | # 5 | # Copyright 2013, Chendil Kumar Manoharan 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 | default['tomcat_latest']['tomcat_url_7'] = "http://tomcat.apache.org/download-70.cgi" 20 | default['tomcat_latest']['tomcat_url_6'] = "http://tomcat.apache.org/download-60.cgi" 21 | default['tomcat_latest']['tomcat_install_loc'] = "/tmp/apache" 22 | default['tomcat_latest']['tomcat_version'] = '7' 23 | default["tomcat_latest"]["port"] = 8080 24 | default["tomcat_latest"]["ssl_port"] = 8443 25 | default["tomcat_latest"]["ajp_port"] = 8009 26 | default["tomcat_latest"]["java_options"] = "-Xmx128M" 27 | default["tomcat_latest"]["use_security_manager"] = false 28 | default["tomcat_latest"]["authbind"] = "no" 29 | default['tomcat_latest']['direct_download_version'] = "na" 30 | default['tomcat_latest']['tomcat_user'] = "root" 31 | default['tomcat_latest']['auto_start'] = "true" 32 | 33 | case platform 34 | when "suse" 35 | default["tomcat_latest"]["user"] = "vagrant" 36 | default["tomcat_latest"]["group"] = "vagrant" 37 | default["tomcat_latest"]["home"] = "#{tomcat_latest["tomcat_install_loc"]}/tomcat6/apache-tomcat-6.0.36" 38 | default["tomcat_latest"]["base"] = "#{tomcat_latest["tomcat_install_loc"]}/tomcat6/apache-tomcat-6.0.36" 39 | default["tomcat_latest"]["config_dir"] = "#{tomcat_latest["tomcat_install_loc"]}/tomcat6/apache-tomcat-6.0.36/conf" 40 | default["tomcat_latest"]["log_dir"] = "#{tomcat_latest["tomcat_install_loc"]}/tomcat6/apache-tomcat-6.0.36/logs" 41 | default["tomcat_latest"]["tmp_dir"] = "#{tomcat_latest["tomcat_install_loc"]}/tomcat6/apache-tomcat-6.0.36/temp" 42 | default["tomcat_latest"]["work_dir"] = "#{tomcat_latest["tomcat_install_loc"]}/tomcat6/apache-tomcat-6.0.36/work" 43 | default["tomcat_latest"]["context_dir"] = "#{tomcat_latest["config_dir"]}/Catalina/localhost" 44 | default["tomcat_latest"]["webapp_dir"] = "#{tomcat_latest["tomcat_install_loc"]}/tomcat6/apache-tomcat-6.0.36/webapps" 45 | end 46 | -------------------------------------------------------------------------------- /chef/supermarket/java/recipes/ibm.rb: -------------------------------------------------------------------------------- 1 | # Author:: Joshua Timberman () 2 | # Cookbook Name:: java 3 | # Recipe:: ibm 4 | # 5 | # Copyright 2013, Opscode, Inc. 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 'uri' 20 | 21 | source_url = node['java']['ibm']['url'] 22 | jdk_uri = ::URI.parse(source_url) 23 | jdk_filename = ::File.basename(jdk_uri.path) 24 | 25 | unless valid_ibm_jdk_uri?(source_url) 26 | raise "You must set the attribute `node['java']['ibm']['url']` to a valid HTTP URI" 27 | end 28 | 29 | # "installable package" installer needs rpm on Ubuntu 30 | if platform_family?('debian') && jdk_filename !~ /archive/ 31 | package "rpm" do 32 | action :install 33 | end 34 | end 35 | 36 | template "#{Chef::Config[:file_cache_path]}/installer.properties" do 37 | source "ibm_jdk.installer.properties.erb" 38 | only_if { node['java']['ibm']['accept_ibm_download_terms'] } 39 | end 40 | 41 | remote_file "#{Chef::Config[:file_cache_path]}/#{jdk_filename}" do 42 | source source_url 43 | mode 00755 44 | if node['java']['ibm']['checksum'] 45 | checksum node['java']['ibm']['checksum'] 46 | action :create 47 | else 48 | action :create_if_missing 49 | end 50 | notifies :run, "execute[install-ibm-java]", :immediately 51 | end 52 | 53 | java_alternatives 'set-java-alternatives' do 54 | java_location node['java']['java_home'] 55 | default node['java']['set_default'] 56 | case node['java']['jdk_version'].to_s 57 | when "6" 58 | bin_cmds node['java']['ibm']['6']['bin_cmds'] 59 | when "7" 60 | bin_cmds node['java']['ibm']['7']['bin_cmds'] 61 | end 62 | action :nothing 63 | end 64 | 65 | execute "install-ibm-java" do 66 | cwd Chef::Config[:file_cache_path] 67 | environment({ 68 | "_JAVA_OPTIONS" => "-Dlax.debug.level=3 -Dlax.debug.all=true", 69 | "LAX_DEBUG" => "1" 70 | }) 71 | command "./#{jdk_filename} -f ./installer.properties -i silent" 72 | notifies :set, 'java_alternatives[set-java-alternatives]', :immediately 73 | creates "#{node['java']['java_home']}/jre/bin/java" 74 | end 75 | 76 | include_recipe "java::set_java_home" 77 | -------------------------------------------------------------------------------- /chef/supermarket/java/.kitchen.yml: -------------------------------------------------------------------------------- 1 | --- 2 | driver: 3 | name: vagrant 4 | require_chef_omnibus: true 5 | customize: 6 | memory: 1024 7 | 8 | provisioner: 9 | name: chef_solo 10 | attributes: 11 | java: 12 | ark_retries: 2 13 | ark_retry_delay: 10 14 | 15 | platforms: 16 | - name: ubuntu-14.04 17 | run_list: 18 | - recipe[apt] 19 | driver: 20 | box: opscode-ubuntu-14.04 21 | - name: ubuntu-13.10 22 | driver: 23 | box: opscode-ubuntu-13.10 24 | run_list: 25 | - recipe[apt] 26 | - name: ubuntu-12.04 27 | driver: 28 | box: opscode-ubuntu-12.04 29 | run_list: 30 | - recipe[apt] 31 | - name: ubuntu-10.04 32 | driver: 33 | box: opscode-ubuntu-10.04 34 | run_list: 35 | - recipe[apt] 36 | - name: debian-6.0.8 37 | driver: 38 | box: opscode-debian-6.0.8 39 | run_list: 40 | - recipe[apt] 41 | - name: debian-7.4 42 | driver: 43 | box: opscode-debian-7.4 44 | run_list: 45 | - recipe[apt] 46 | - name: centos-6.5 47 | driver: 48 | box: opscode-centos-6.5 49 | - name: centos-5.10 50 | driver: 51 | box: opscode-centos-5.10 52 | - name: fedora-19 53 | driver: 54 | box: opscode-fedora-19 55 | 56 | suites: 57 | - name: openjdk 58 | excludes: 59 | - fedora-19 60 | run_list: 61 | - recipe[java::default] 62 | - name: openjdk-7 63 | excludes: 64 | - ubuntu-10.04 65 | - debian-6.0.8 66 | run_list: 67 | - recipe[java::default] 68 | attributes: 69 | java: 70 | jdk_version: "7" 71 | - name: oracle 72 | run_list: 73 | - recipe[java::default] 74 | attributes: 75 | java: 76 | oracle: 77 | accept_oracle_download_terms: true 78 | install_flavor: oracle 79 | - name: oracle-7 80 | run_list: 81 | - recipe[java::default] 82 | attributes: 83 | java: 84 | jdk_version: "7" 85 | oracle: 86 | accept_oracle_download_terms: true 87 | install_flavor: oracle 88 | - name: oracle-8 89 | run_list: 90 | - recipe[java::default] 91 | attributes: 92 | java: 93 | jdk_version: "8" 94 | oracle: 95 | accept_oracle_download_terms: true 96 | install_flavor: oracle 97 | - name: oracle-direct 98 | run_list: 99 | - recipe[java::oracle] 100 | attributes: 101 | java: 102 | oracle: 103 | accept_oracle_download_terms: true 104 | - name: openjdk-direct 105 | run_list: 106 | - recipe[java::openjdk] 107 | excludes: 108 | - fedora-19 109 | -------------------------------------------------------------------------------- /chef/supermarket/java/recipes/windows.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Author:: Kendrick Martin () 3 | # Cookbook Name:: java 4 | # Recipe:: windows 5 | # 6 | # Copyright 2008-2012 Webtrends, Inc. 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 | require 'uri' 22 | 23 | Chef::Log.fatal("No download url set for java installer.") unless node['java'] && node['java']['windows'] && node['java']['windows']['url'] 24 | 25 | pkg_checksum = node['java']['windows']['checksum'] 26 | aws_access_key_id = node['java']['windows']['aws_access_key_id'] 27 | aws_secret_access_key = node['java']['windows']['aws_secret_access_key'] 28 | 29 | uri = ::URI.parse(node['java']['windows']['url']) 30 | cache_file_path = File.join(Chef::Config[:file_cache_path], File.basename(::URI.unescape(uri.path))) 31 | 32 | if aws_access_key_id && aws_secret_access_key 33 | include_recipe 'aws::default' # install right_aws gem for aws_s3_file 34 | 35 | aws_s3_file cache_file_path do 36 | aws_access_key_id aws_access_key_id 37 | aws_secret_access_key aws_secret_access_key 38 | checksum pkg_checksum if pkg_checksum 39 | bucket node['java']['windows']['bucket'] 40 | remote_path node['java']['windows']['remote_path'] 41 | backup false 42 | action :create 43 | end 44 | else 45 | remote_file cache_file_path do 46 | checksum pkg_checksum if pkg_checksum 47 | source node['java']['windows']['url'] 48 | backup false 49 | action :create 50 | end 51 | end 52 | 53 | if node['java'].attribute?("java_home") 54 | java_home_win = win_friendly_path(node['java']['java_home']) 55 | # The EXE installer expects escaped quotes, so we need to double escape 56 | # them here. The final string looks like : 57 | # /v"/qn INSTALLDIR=\"C:\Program Files\Java\"" 58 | additional_options = "/v\"/qn INSTALLDIR=\\\"#{java_home_win}\\\"\"" 59 | 60 | env "JAVA_HOME" do 61 | value java_home_win 62 | end 63 | 64 | # update path 65 | windows_path "#{java_home_win}\\bin" do 66 | action :add 67 | end 68 | end 69 | 70 | 71 | windows_package node['java']['windows']['package_name'] do 72 | source cache_file_path 73 | checksum node['java']['windows']['checksum'] 74 | action :install 75 | installer_type :custom 76 | options "/s #{additional_options}" 77 | end 78 | -------------------------------------------------------------------------------- /chef/supermarket/java/recipes/set_attributes_from_version.rb: -------------------------------------------------------------------------------- 1 | # Cookbook Name:: java 2 | # Recipe:: set_attributes_from_version 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # Calculate variables that depend on jdk_version 17 | # If you need to override this in an attribute file you must use 18 | # force_default or higher precedence. 19 | 20 | case node['platform_family'] 21 | when "rhel", "fedora" 22 | case node['java']['install_flavor'] 23 | when "oracle" 24 | node.default['java']['java_home'] = "/usr/lib/jvm/java" 25 | when "oracle_rpm" 26 | node.default['java']['java_home'] = "/usr/java/latest" 27 | else 28 | node.default['java']['java_home'] = "/usr/lib/jvm/java-1.#{node['java']['jdk_version']}.0" 29 | end 30 | node.default['java']['openjdk_packages'] = ["java-1.#{node['java']['jdk_version']}.0-openjdk", "java-1.#{node['java']['jdk_version']}.0-openjdk-devel"] 31 | when "freebsd" 32 | node.default['java']['java_home'] = "/usr/local/openjdk#{node['java']['jdk_version']}" 33 | node.default['java']['openjdk_packages'] = ["openjdk#{node['java']['jdk_version']}"] 34 | when "arch" 35 | node.default['java']['java_home'] = "/usr/lib/jvm/java-#{node['java']['jdk_version']}-openjdk" 36 | node.default['java']['openjdk_packages'] = ["openjdk#{node['java']['jdk_version']}"] 37 | when "debian" 38 | node.default['java']['java_home'] = "/usr/lib/jvm/java-#{node['java']['jdk_version']}-#{node['java']['install_flavor']}" 39 | # Newer Debian & Ubuntu adds the architecture to the path 40 | if node['platform'] == 'debian' && Chef::VersionConstraint.new(">= 7.0").include?(node['platform_version']) || 41 | node['platform'] == 'ubuntu' && Chef::VersionConstraint.new(">= 12.04").include?(node['platform_version']) 42 | node.default['java']['java_home'] = "#{node['java']['java_home']}-#{node['kernel']['machine'] == 'x86_64' ? 'amd64' : 'i386'}" 43 | end 44 | node.default['java']['openjdk_packages'] = ["openjdk-#{node['java']['jdk_version']}-jdk", "openjdk-#{node['java']['jdk_version']}-jre-headless"] 45 | when "smartos" 46 | node.default['java']['java_home'] = "/opt/local/java/sun6" 47 | node.default['java']['openjdk_packages'] = ["sun-jdk#{node['java']['jdk_version']}", "sun-jre#{node['java']['jdk_version']}"] 48 | when "windows" 49 | # Do nothing otherwise we will fall through to the else and set java_home to an invalid path, causing the installer to popup a dialog 50 | else 51 | node.default['java']['java_home'] = "/usr/lib/jvm/default-java" 52 | node.default['java']['openjdk_packages'] = ["openjdk-#{node['java']['jdk_version']}-jdk"] 53 | end 54 | -------------------------------------------------------------------------------- /chef/supermarket/java/providers/alternatives.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: java 3 | # Provider:: alternatives 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | require 'chef/mixin/shell_out' 18 | include Chef::Mixin::ShellOut 19 | 20 | action :set do 21 | if new_resource.bin_cmds 22 | # I couldn't find a way to cleanly avoid repeating this variable declaration in both :set and :unset 23 | alternatives_cmd = node['platform_family'] == 'rhel' ? 'alternatives' : 'update-alternatives' 24 | new_resource.bin_cmds.each do |cmd| 25 | 26 | bin_path = "/usr/bin/#{cmd}" 27 | alt_path = "#{new_resource.java_location}/bin/#{cmd}" 28 | priority = new_resource.priority 29 | 30 | if !::File.exist?(alt_path) 31 | Chef::Log.debug "Skipping setting alternative for #{cmd}. Command #{alt_path} does not exist." 32 | next 33 | end 34 | 35 | # install the alternative if needed 36 | alternative_exists = shell_out("#{alternatives_cmd} --display #{cmd} | grep #{alt_path}").exitstatus == 0 37 | unless alternative_exists 38 | description = "Add alternative for #{cmd}" 39 | converge_by(description) do 40 | Chef::Log.debug "Adding alternative for #{cmd}" 41 | shell_out("rm /var/lib/alternatives/#{cmd}") 42 | install_cmd = shell_out("#{alternatives_cmd} --install #{bin_path} #{cmd} #{alt_path} #{priority}") 43 | unless install_cmd.exitstatus == 0 44 | Chef::Application.fatal!(%Q[ set alternative failed ]) 45 | end 46 | end 47 | new_resource.updated_by_last_action(true) 48 | end 49 | 50 | # set the alternative if default 51 | if new_resource.default 52 | alternative_is_set = shell_out("#{alternatives_cmd} --display #{cmd} | grep \"link currently points to #{alt_path}\"").exitstatus == 0 53 | unless alternative_is_set 54 | description = "Set alternative for #{cmd}" 55 | converge_by(description) do 56 | Chef::Log.debug "Setting alternative for #{cmd}" 57 | set_cmd = shell_out("#{alternatives_cmd} --set #{cmd} #{alt_path}") 58 | unless set_cmd.exitstatus == 0 59 | Chef::Application.fatal!(%Q[ set alternative failed ]) 60 | end 61 | end 62 | new_resource.updated_by_last_action(true) 63 | end 64 | end 65 | end 66 | end 67 | end 68 | 69 | action :unset do 70 | # I couldn't find a way to cleanly avoid repeating this variable declaration in both :set and :unset 71 | alternatives_cmd = node['platform_family'] == 'rhel' ? 'alternatives' : 'update-alternatives' 72 | new_resource.bin_cmds.each do |cmd| 73 | alt_path = "#{new_resource.java_location}/bin/#{cmd}" 74 | cmd = shell_out("#{alternatives_cmd} --remove #{cmd} #{alt_path}") 75 | if cmd.exitstatus == 0 76 | new_resource.updated_by_last_action(true) 77 | end 78 | end 79 | end 80 | -------------------------------------------------------------------------------- /chef/supermarket/java/libraries/helpers.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Author:: Joshua Timberman 3 | # Copyright:: Copyright (c) 2013, Opscode, Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | require 'chef/version_constraint' 19 | require 'uri' 20 | require 'pathname' 21 | 22 | module Opscode 23 | class OpenJDK 24 | 25 | attr_accessor :java_home, :jdk_version 26 | 27 | def initialize(node) 28 | @node = node.to_hash 29 | @java_home = @node['java']['java_home'] || '/usr/lib/jvm/default-java' 30 | @jdk_version = @node['java']['jdk_version'].to_s || '6' 31 | end 32 | 33 | def java_location 34 | File.join(java_home_parent(@java_home), openjdk_path, 'bin/java') 35 | end 36 | 37 | def alternatives_priority 38 | if @jdk_version == '6' 39 | # 'accepted' default for java 6 40 | 1061 41 | elsif @jdk_version == '7' 42 | # i just made this number up 43 | 1100 44 | elsif @jdk_version.to_i > 7 45 | # just a guard against the incoming java 8 46 | # so this cookbook will actually work for.. new versions of java 47 | 1110 48 | else 49 | # it's not 6, it's not 7, it's not newer than 50 | # 7, but we probably want to install it, so 51 | # override 6's priority. arbitrary number. 52 | 1062 53 | end 54 | end 55 | 56 | def java_home_parent(java_home) 57 | Pathname.new(java_home).parent.to_s 58 | end 59 | 60 | def openjdk_path 61 | case @node['platform_family'] 62 | when 'debian' 63 | 'java-%s-openjdk%s/jre' % [@jdk_version, arch_dir] 64 | when 'rhel', 'fedora' 65 | 'jre-1.%s.0-openjdk%s' % [@jdk_version, arch_dir] 66 | when 'smartos' 67 | 'jre' 68 | else 69 | 'jre' 70 | end 71 | end 72 | 73 | def arch_dir 74 | @node['kernel']['machine'] == 'x86_64' ? sixty_four : thirty_two 75 | end 76 | 77 | def sixty_four 78 | case @node['platform_family'] 79 | when 'debian' 80 | old_version? ? '' : '-amd64' 81 | when 'rhel', 'fedora' 82 | '.x86_64' 83 | else 84 | '-x86_64' 85 | end 86 | end 87 | 88 | def thirty_two 89 | case @node['platform_family'] 90 | when 'debian' 91 | old_version? ? '' : '-i386' 92 | else 93 | '' 94 | end 95 | end 96 | 97 | # This method is used above (#sixty_four, #thirty_two) so we know 98 | # whether to specify the architecture as part of the path name. 99 | def old_version? 100 | case @node['platform'] 101 | when 'ubuntu' 102 | Chef::VersionConstraint.new("< 11.0").include?(@node['platform_version']) 103 | when 'debian' 104 | Chef::VersionConstraint.new("< 7.0").include?(@node['platform_version']) 105 | end 106 | end 107 | end 108 | end 109 | 110 | class Chef 111 | class Recipe 112 | def valid_ibm_jdk_uri?(url) 113 | url =~ ::URI::ABS_URI && %w[file http https].include?(::URI.parse(url).scheme) 114 | end 115 | 116 | def platform_requires_license_acceptance? 117 | %w(smartos).include?(node.platform) 118 | end 119 | end 120 | end 121 | -------------------------------------------------------------------------------- /chef/supermarket/java/attributes/default.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Author:: Seth Chisamore () 3 | # Cookbook Name:: java 4 | # Attributes:: default 5 | # 6 | # Copyright 2010, Opscode, Inc. 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 | # default jdk attributes 21 | default['java']['jdk_version'] = '6' 22 | default['java']['arch'] = kernel['machine'] =~ /x86_64/ ? "x86_64" : "i586" 23 | default['java']['openjdk_packages'] = [] 24 | default['java']['accept_license_agreement'] = false 25 | default['java']['set_default'] = true 26 | default['java']['alternatives_priority'] = 1062 27 | default['java']['set_etc_environment'] = false 28 | 29 | # the following retry parameters apply when downloading oracle java 30 | default['java']['ark_retries'] = 0 31 | default['java']['ark_retry_delay'] = 2 32 | 33 | case node['platform_family'] 34 | when "windows" 35 | default['java']['install_flavor'] = "windows" 36 | default['java']['windows']['url'] = nil 37 | default['java']['windows']['checksum'] = nil 38 | default['java']['windows']['package_name'] = "Java(TM) SE Development Kit 7 (64-bit)" 39 | else 40 | default['java']['install_flavor'] = "openjdk" 41 | end 42 | 43 | case node['java']['install_flavor'] 44 | when 'ibm', 'ibm_tar' 45 | default['java']['ibm']['url'] = nil 46 | default['java']['ibm']['checksum'] = nil 47 | default['java']['ibm']['accept_ibm_download_terms'] = false 48 | default['java']['java_home'] = "/opt/ibm/java" 49 | 50 | default['java']['ibm']['6']['bin_cmds'] = [ "appletviewer", "apt", "ControlPanel", "extcheck", "HtmlConverter", "idlj", "jar", "jarsigner", 51 | "java", "javac", "javadoc", "javah", "javap", "javaws", "jconsole", "jcontrol", "jdb", "jdmpview", 52 | "jrunscript", "keytool", "native2ascii", "policytool", "rmic", "rmid", "rmiregistry", 53 | "schemagen", "serialver", "tnameserv", "wsgen", "wsimport", "xjc" ] 54 | 55 | default['java']['ibm']['7']['bin_cmds'] = node['java']['ibm']['6']['bin_cmds'] + [ "pack200", "unpack200" ] 56 | when 'oracle_rpm' 57 | default['java']['oracle_rpm']['type'] = 'jdk' 58 | default['java']['java_home'] = "/usr/java/latest" 59 | end 60 | 61 | # if you change this to true, you can download directly from Oracle 62 | default['java']['oracle']['accept_oracle_download_terms'] = false 63 | 64 | # direct download paths for oracle, you have been warned! 65 | 66 | # jdk6 attributes 67 | default['java']['jdk']['6']['bin_cmds'] = [ "appletviewer", "apt", "ControlPanel", "extcheck", "HtmlConverter", "idlj", "jar", "jarsigner", 68 | "java", "javac", "javadoc", "javah", "javap", "javaws", "jconsole", "jcontrol", "jdb", "jhat", 69 | "jinfo", "jmap", "jps", "jrunscript", "jsadebugd", "jstack", "jstat", "jstatd", "jvisualvm", 70 | "keytool", "native2ascii", "orbd", "pack200", "policytool", "rmic", "rmid", "rmiregistry", 71 | "schemagen", "serialver", "servertool", "tnameserv", "unpack200", "wsgen", "wsimport", "xjc"] 72 | 73 | # x86_64 74 | default['java']['jdk']['6']['x86_64']['url'] = 'http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64.bin' 75 | default['java']['jdk']['6']['x86_64']['checksum'] = '6b493aeab16c940cae9e3d07ad2a5c5684fb49cf06c5d44c400c7993db0d12e8' 76 | 77 | # i586 78 | default['java']['jdk']['6']['i586']['url'] = 'http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin' 79 | default['java']['jdk']['6']['i586']['checksum'] = 'd53b5a2518d80e1d95565f0adda54eee229dc5f4a1d1a3c2f7bf5045b168a357' 80 | 81 | # jdk7 attributes 82 | 83 | default['java']['jdk']['7']['bin_cmds'] = [ "appletviewer", "apt", "ControlPanel", "extcheck", "idlj", "jar", "jarsigner", "java", "javac", 84 | "javadoc", "javafxpackager", "javah", "javap", "javaws", "jcmd", "jconsole", "jcontrol", "jdb", 85 | "jhat", "jinfo", "jmap", "jps", "jrunscript", "jsadebugd", "jstack", "jstat", "jstatd", "jvisualvm", 86 | "keytool", "native2ascii", "orbd", "pack200", "policytool", "rmic", "rmid", "rmiregistry", 87 | "schemagen", "serialver", "servertool", "tnameserv", "unpack200", "wsgen", "wsimport", "xjc"] 88 | 89 | # Oracle doesn't seem to publish SHA256 checksums for Java releases, so we use MD5 instead. 90 | # Official checksums for the latest release can be found at http://www.oracle.com/technetwork/java/javase/downloads/java-se-binaries-checksum-1956892.html 91 | 92 | # x86_64 93 | default['java']['jdk']['7']['x86_64']['url'] = 'http://download.oracle.com/otn-pub/java/jdk/7u65-b17/jdk-7u65-linux-x64.tar.gz' 94 | default['java']['jdk']['7']['x86_64']['checksum'] = 'c223bdbaf706f986f7a5061a204f641f' 95 | 96 | # i586 97 | default['java']['jdk']['7']['i586']['url'] = 'http://download.oracle.com/otn-pub/java/jdk/7u65-b17/jdk-7u65-linux-i586.tar.gz' 98 | default['java']['jdk']['7']['i586']['checksum'] = 'bfe1f792918aca2fbe53157061e2145c' 99 | 100 | # jdk8 attributes 101 | 102 | default['java']['jdk']['8']['bin_cmds'] = [ "appletviewer", "apt", "ControlPanel", "extcheck", "idlj", "jar", "jarsigner", "java", "javac", 103 | "javadoc", "javafxpackager", "javah", "javap", "javaws", "jcmd", "jconsole", "jcontrol", "jdb", 104 | "jdeps", "jhat", "jinfo", "jjs", "jmap", "jmc", "jps", "jrunscript", "jsadebugd", "jstack", 105 | "jstat", "jstatd", "jvisualvm", "keytool", "native2ascii", "orbd", "pack200", "policytool", 106 | "rmic", "rmid", "rmiregistry", "schemagen", "serialver", "servertool", "tnameserv", 107 | "unpack200", "wsgen", "wsimport", "xjc"] 108 | 109 | # Oracle doesn't seem to publish SHA256 checksums for Java releases, so we use MD5 instead. 110 | # Official checksums for the latest release can be found at http://www.oracle.com/technetwork/java/javase/downloads/javase8-binaries-checksum-2133161.html 111 | 112 | # x86_64 113 | default['java']['jdk']['8']['x86_64']['url'] = 'http://download.oracle.com/otn-pub/java/jdk/8u11-b12/jdk-8u11-linux-x64.tar.gz' 114 | default['java']['jdk']['8']['x86_64']['checksum'] = '13ee1d0bf6baaf2b119115356f234a48' 115 | 116 | # i586 117 | default['java']['jdk']['8']['i586']['url'] = 'http://download.oracle.com/otn-pub/java/jdk/8u11-b12/jdk-8u11-linux-i586.tar.gz' 118 | default['java']['jdk']['8']['i586']['checksum'] = '252bd6545d765ccf9d52ac3ef2ebf0aa' 119 | -------------------------------------------------------------------------------- /chef/supermarket/tomcat_latest/templates/default/server7.xml.erb: -------------------------------------------------------------------------------- 1 | 2 | 18 | 22 | 23 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 38 | 39 | 42 | 47 | 48 | 49 | 54 | 55 | 56 | 57 | 61 | 62 | 63 | 70 | " protocol="HTTP/1.1" 71 | connectionTimeout="20000" 72 | redirectPort="<%= node["tomcat_latest"]["ssl_port"] %>" /> 73 | 74 | 80 | 84 | 89 | 90 | 91 | " protocol="AJP/1.3" redirectPort="<%= node["tomcat_latest"]["ssl_port"] %>" /> 92 | 93 | 94 | 99 | 100 | 103 | 104 | 105 | 108 | 111 | 112 | 114 | 115 | 119 | 121 | 122 | 123 | 125 | 126 | 128 | 131 | 132 | 135 | 138 | 139 | 140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /chef/supermarket/tomcat_latest/templates/default/server6.xml.erb: -------------------------------------------------------------------------------- 1 | 2 | 18 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 37 | 38 | 41 | 46 | 47 | 48 | 53 | 54 | 55 | 56 | 60 | 61 | 62 | 69 | " protocol="HTTP/1.1" 70 | connectionTimeout="20000" 71 | redirectPort="<%= node["tomcat_latest"]["ssl_port"] %>" /> 72 | 73 | 79 | 83 | 88 | 89 | 90 | " protocol="AJP/1.3" redirectPort="<%= node["tomcat_latest"]["ssl_port"] %>" /> 91 | 92 | 93 | 98 | 99 | 102 | 103 | 104 | 107 | 110 | 111 | 114 | 117 | 118 | 122 | 124 | 125 | 128 | 131 | 132 | 134 | 137 | 138 | 140 | 144 | 145 | 146 | 147 | 148 | 149 | -------------------------------------------------------------------------------- /chef/supermarket/tomcat_latest/recipes/default.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: tomcat_latest 3 | # Recipe:: default 4 | # 5 | # Copyright 2013, Chendil Kumar Manoharan 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 | 20 | tomcat_version = node['tomcat_latest']['tomcat_version'] 21 | tomcat_install_loc=node['tomcat_latest']['tomcat_install_loc'] 22 | platform=node['platform'] 23 | platform_version=node['platform_version'] 24 | direct_download_version=node['tomcat_latest']['direct_download_version'] 25 | tomcat_user=node['tomcat_latest']['tomcat_user'] 26 | auto_start=node['tomcat_latest']['auto_start'] 27 | 28 | 29 | if ( !(File.exists?("/etc/init.d/tomcat7") || File.exists?("/etc/init.d/tomcat6") || File.exists?("/etc/init.d/tomcat") || File.exists?("/etc/rc.d/tomcat7") || File.exists?("/etc/rc.d/tomcat6") || File.exists?("/etc/rc.d/tomcat"))) 30 | 31 | if platform=="suse" || platform=="centos" || platform=="fedora" || platform=="ubuntu" || platform=="debian" 32 | 33 | if direct_download_version!="na" 34 | 35 | include_recipe "java" 36 | if ( direct_download_version =~ /7(.*)/ ) 37 | direct_download_url= "http://archive.apache.org/dist/tomcat/tomcat-7/v"+"#{direct_download_version}"+"/bin/apache-tomcat-#{direct_download_version}.tar.gz"; 38 | else if ( direct_download_version =~ /6(.*)/ ) 39 | direct_download_url= "http://archive.apache.org/dist/tomcat/tomcat-6/v"+"#{direct_download_version}"+"/bin/apache-tomcat-#{direct_download_version}.tar.gz"; 40 | else 41 | abort("Unsupported tomcat version "+"#{direct_download_version}"+"specified") 42 | end 43 | end 44 | 45 | script "Download Apache Tomcat #{direct_download_version}" do 46 | interpreter "bash" 47 | user "#{tomcat_user}" 48 | cwd "/tmp" 49 | code <<-EOH 50 | wget "#{direct_download_url}" -O "/tmp/apache-tomcat-#{direct_download_version}.tar.gz" 51 | mkdir -p #{tomcat_install_loc}/tomcat 52 | EOH 53 | end 54 | 55 | unzip_tomcat6or7 "d" do 56 | enable true 57 | end 58 | 59 | 60 | 61 | execute "Change the directory name to apache-tomcat" do 62 | user "#{tomcat_user}" 63 | cwd #{tomcat_install_loc}/tomcat 64 | command "cd #{tomcat_install_loc}/tomcat; mv apache-tomcat-* apache-tomcat" 65 | not_if { ::File.directory?("/#{tomcat_install_loc}/tomcat/apache-tomcat")} 66 | action :run 67 | end 68 | 69 | if ( direct_download_version =~ /7(.*)/ ) 70 | 71 | template "#{tomcat_install_loc}/tomcat/apache-tomcat/conf/server.xml" do 72 | source "server7.xml.erb" 73 | owner "#{tomcat_user}" 74 | mode "0644" 75 | end 76 | else if ( direct_download_version =~ /6(.*)/ ) 77 | 78 | template "#{tomcat_install_loc}/tomcat/apache-tomcat/conf/server.xml" do 79 | source "server6.xml.erb" 80 | owner "#{tomcat_user}" 81 | mode "0644" 82 | end 83 | 84 | else 85 | abort("Unsupported tomcat version "+"#{direct_download_version}"+"specified") 86 | end 87 | end 88 | if platform=="suse" || platform=="centos" || platform=="fedora" 89 | template "/etc/rc.d/tomcat" do 90 | source "tomcat.erb" 91 | owner "#{tomcat_user}" 92 | mode "0755" 93 | end 94 | end 95 | 96 | if platform=="ubuntu" || platform=="debian" 97 | template "/etc/init.d/tomcat" do 98 | source "tomcat.erb" 99 | owner "#{tomcat_user}" 100 | mode "0755" 101 | end 102 | end 103 | if auto_start=="true" 104 | if platform=="suse" || platform=="ubuntu"|| platform=="debian" 105 | 106 | script "Start tomcat" do 107 | interpreter "bash" 108 | user "#{tomcat_user}" 109 | cwd "/tmp" 110 | code <<-EOH 111 | /etc/init.d/tomcat start 112 | EOH 113 | end 114 | end 115 | if platform=="centos" || platform=="fedora" 116 | 117 | script "Start tomcat" do 118 | interpreter "bash" 119 | user "#{tomcat_user}" 120 | cwd "/tmp" 121 | code <<-EOH 122 | /etc/rc.d/tomcat start 123 | EOH 124 | end 125 | end 126 | end 127 | end 128 | if direct_download_version=="na" 129 | 130 | 131 | include_recipe "java" 132 | 133 | #convert version number to a string if it isn't already 134 | if tomcat_version.instance_of? Fixnum 135 | tomcat_version = tomcat_version.to_s 136 | end 137 | 138 | case tomcat_version 139 | when "6" 140 | tomcat_url = node['tomcat_latest']['tomcat_url_6'] 141 | script "Download Apache Tomcat 6 " do 142 | interpreter "bash" 143 | user "#{tomcat_user}" 144 | cwd "/tmp" 145 | code <<-EOH 146 | wget #{tomcat_url} -O /tmp/tomcat_pag.txt 147 | url=`grep -m 1 apache-tomcat-6.*.[0-9][0-9].tar.[g][z] /tmp/tomcat_pag.txt | cut -d '"' -f 2` 148 | wget $url 149 | mkdir -p #{tomcat_install_loc}/tomcat6 150 | EOH 151 | end 152 | 153 | 154 | unzip_tomcat6or7 "6" do 155 | enable true 156 | end 157 | execute "Change the directory name to apache-tomcat-6" do 158 | user "#{tomcat_user}" 159 | cwd #{tomcat_install_loc}/tomcat6 160 | command "cd #{tomcat_install_loc}/tomcat6; mv apache-tomcat-6.* apache-tomcat-6" 161 | action :run 162 | end 163 | 164 | 165 | template "#{tomcat_install_loc}/tomcat6/apache-tomcat-6/conf/server.xml" do 166 | source "server6.xml.erb" 167 | owner "#{tomcat_user}" 168 | mode "0644" 169 | end 170 | if platform=="suse" || platform=="centos" || platform=="fedora" 171 | template6or7 "6" do 172 | user true 173 | end 174 | end 175 | 176 | if platform=="ubuntu" || platform=="debian" 177 | template "/etc/init.d/tomcat6" do 178 | source "tomcat6.erb" 179 | owner "#{tomcat_user}" 180 | mode "0755" 181 | end 182 | end 183 | if auto_start =="true" 184 | if platform=="suse" ||platform=="ubuntu" || platform=="debian" 185 | 186 | script "Start tomcat 6 on #{platform}" do 187 | interpreter "bash" 188 | user "#{tomcat_user}" 189 | cwd "/tmp" 190 | code <<-EOH 191 | /etc/init.d/tomcat6 start 192 | EOH 193 | end 194 | end 195 | if platform=="centos" || platform=="fedora" 196 | 197 | script "Start tomcat 6 on #{platform}" do 198 | interpreter "bash" 199 | user "#{tomcat_user}" 200 | cwd "/tmp" 201 | code <<-EOH 202 | /etc/rc.d/tomcat6 start 203 | EOH 204 | end 205 | end 206 | end 207 | 208 | when "7" 209 | tomcat_url = node['tomcat_latest']['tomcat_url_7'] 210 | script "Download Apache Tomcat 7 " do 211 | interpreter "bash" 212 | user "#{tomcat_user}" 213 | cwd "/tmp" 214 | code <<-EOH 215 | wget #{tomcat_url} -O /tmp/tomcat_pag.txt 216 | url=`grep -m 1 apache-tomcat-7.*.[0-9][0-9].tar.[g][z] /tmp/tomcat_pag.txt | cut -d '"' -f 2` 217 | wget $url 218 | mkdir -p #{tomcat_install_loc}/tomcat7 219 | EOH 220 | end 221 | 222 | unzip_tomcat6or7 "7" do 223 | enable true 224 | end 225 | 226 | execute "Change the directory name to apache-tomcat-7" do 227 | user "#{tomcat_user}" 228 | cwd #{tomcat_install_loc}/tomcat7 229 | command "cd #{tomcat_install_loc}/tomcat7; mv apache-tomcat-7.* apache-tomcat-7" 230 | action :run 231 | end 232 | 233 | 234 | template "#{tomcat_install_loc}/tomcat7/apache-tomcat-7/conf/server.xml" do 235 | source "server7.xml.erb" 236 | owner "#{tomcat_user}" 237 | mode "0644" 238 | end 239 | if platform=="suse" || platform=="centos" || platform=="fedora" 240 | template6or7 "7" do 241 | user "#{tomcat_user}" 242 | end 243 | end 244 | 245 | if platform=="ubuntu" 246 | template "/etc/init.d/tomcat7" do 247 | source "tomcat7.erb" 248 | owner "#{tomcat_user}" 249 | mode "0755" 250 | end 251 | end 252 | 253 | if auto_start =="true" 254 | if platform=="suse" ||platform=="ubuntu" || platform=="debian" 255 | 256 | script "Start tomcat 7" do 257 | interpreter "bash" 258 | user "#{tomcat_user}" 259 | cwd "/tmp" 260 | code <<-EOH 261 | /etc/init.d/tomcat7 start 262 | EOH 263 | end 264 | end 265 | if platform=="centos" || platform == "fedora" 266 | 267 | script "Start tomcat 7" do 268 | interpreter "bash" 269 | user "#{tomcat_user}" 270 | cwd "/tmp" 271 | code <<-EOH 272 | /etc/rc.d/tomcat7 start 273 | EOH 274 | end 275 | 276 | end 277 | end 278 | 279 | end 280 | 281 | end 282 | 283 | 284 | else 285 | 286 | Chef::Log.info("#{platform} #{platform_version} is not yet supported.") 287 | 288 | end 289 | 290 | else 291 | 292 | Chef::Log.info("tomcat_latest chef cookbook is already installed") 293 | end 294 | 295 | -------------------------------------------------------------------------------- /chef/supermarket/java/providers/ark.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Author:: Bryan W. Berry () 3 | # Cookbook Name:: java 4 | # Provider:: ark 5 | # 6 | # Copyright 2011, Bryan w. Berry 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 | require 'chef/mixin/shell_out' 21 | include Chef::Mixin::ShellOut 22 | 23 | def whyrun_supported? 24 | true 25 | end 26 | 27 | def parse_app_dir_name url 28 | file_name = url.split('/')[-1] 29 | # funky logic to parse oracle's non-standard naming convention 30 | # for jdk1.6 31 | if file_name =~ /^(jre|jdk|server-jre).*$/ 32 | major_num = file_name.scan(/\d/)[0] 33 | update_token = file_name.scan(/u(\d+)/)[0] 34 | update_num = update_token ? update_token[0] : "0" 35 | # pad a single digit number with a zero 36 | if update_num.length < 2 37 | update_num = "0" + update_num 38 | end 39 | package_name = (file_name =~ /^server-jre.*$/) ? "jdk" : file_name.scan(/[a-z]+/)[0] 40 | if update_num == "00" 41 | app_dir_name = "#{package_name}1.#{major_num}.0" 42 | else 43 | app_dir_name = "#{package_name}1.#{major_num}.0_#{update_num}" 44 | end 45 | else 46 | app_dir_name = file_name.split(/(.tgz|.tar.gz|.zip)/)[0] 47 | app_dir_name = app_dir_name.split("-bin")[0] 48 | end 49 | [app_dir_name, file_name] 50 | end 51 | 52 | def oracle_downloaded?(download_path, new_resource) 53 | if ::File.exists? download_path 54 | require 'digest' 55 | if new_resource.checksum =~ /^[0-9a-f]{32}$/ 56 | downloaded_sha = Digest::MD5.file(download_path).hexdigest 57 | downloaded_sha == new_resource.md5 58 | else 59 | downloaded_sha = Digest::SHA256.file(download_path).hexdigest 60 | downloaded_sha == new_resource.checksum 61 | end 62 | else 63 | return false 64 | end 65 | end 66 | 67 | def download_direct_from_oracle(tarball_name, new_resource) 68 | download_path = "#{Chef::Config[:file_cache_path]}/#{tarball_name}" 69 | cookie = "oraclelicense=accept-securebackup-cookie" 70 | if node['java']['oracle']['accept_oracle_download_terms'] 71 | # install the curl package 72 | p = package "curl" do 73 | action :nothing 74 | end 75 | # no converge_by block since the package provider will take care of this run_action 76 | p.run_action(:install) 77 | description = "download oracle tarball straight from the server" 78 | converge_by(description) do 79 | Chef::Log.debug "downloading oracle tarball straight from the source" 80 | cmd = shell_out!( 81 | %Q[ curl --create-dirs -L --retry #{new_resource.retries} --retry-delay #{new_resource.retry_delay} --cookie "#{cookie}" #{new_resource.url} -o #{download_path} ] 82 | ) 83 | end 84 | else 85 | Chef::Application.fatal!("You must set the attribute node['java']['oracle']['accept_oracle_download_terms'] to true if you want to download directly from the oracle site!") 86 | end 87 | end 88 | 89 | action :install do 90 | app_dir_name, tarball_name = parse_app_dir_name(new_resource.url) 91 | app_root = new_resource.app_home.split('/')[0..-2].join('/') 92 | app_dir = app_root + '/' + app_dir_name 93 | 94 | unless new_resource.default 95 | Chef::Log.debug("processing alternate jdk") 96 | app_dir = app_dir + "_alt" 97 | app_home = new_resource.app_home + "_alt" 98 | else 99 | app_home = new_resource.app_home 100 | end 101 | 102 | unless ::File.exists?(app_dir) 103 | Chef::Log.info "Adding #{new_resource.name} to #{app_dir}" 104 | require 'fileutils' 105 | 106 | unless ::File.exists?(app_root) 107 | description = "create dir #{app_root} and change owner to #{new_resource.owner}" 108 | converge_by(description) do 109 | FileUtils.mkdir app_root, :mode => new_resource.app_home_mode 110 | FileUtils.chown new_resource.owner, new_resource.owner, app_root 111 | end 112 | end 113 | 114 | if new_resource.url =~ /^http:\/\/download.oracle.com.*$/ 115 | download_path = "#{Chef::Config[:file_cache_path]}/#{tarball_name}" 116 | if oracle_downloaded?(download_path, new_resource) 117 | Chef::Log.debug("oracle tarball already downloaded, not downloading again") 118 | else 119 | download_direct_from_oracle tarball_name, new_resource 120 | end 121 | else 122 | Chef::Log.debug("downloading tarball from an unofficial repository") 123 | r = remote_file "#{Chef::Config[:file_cache_path]}/#{tarball_name}" do 124 | source new_resource.url 125 | checksum new_resource.checksum 126 | retries new_resource.retries 127 | retry_delay new_resource.retry_delay 128 | mode 0755 129 | action :nothing 130 | end 131 | #no converge by on run_action remote_file takes care of it. 132 | r.run_action(:create_if_missing) 133 | end 134 | 135 | description = "extract compressed data into Chef file cache path and 136 | move extracted data to #{app_dir}" 137 | converge_by(description) do 138 | case tarball_name 139 | when /^.*\.bin/ 140 | cmd = shell_out( 141 | %Q[ cd "#{Chef::Config[:file_cache_path]}"; 142 | bash ./#{tarball_name} -noregister 143 | ] ) 144 | unless cmd.exitstatus == 0 145 | Chef::Application.fatal!("Failed to extract file #{tarball_name}!") 146 | end 147 | when /^.*\.zip/ 148 | cmd = shell_out( 149 | %Q[ unzip "#{Chef::Config[:file_cache_path]}/#{tarball_name}" -d "#{Chef::Config[:file_cache_path]}" ] 150 | ) 151 | unless cmd.exitstatus == 0 152 | Chef::Application.fatal!("Failed to extract file #{tarball_name}!") 153 | end 154 | when /^.*\.(tar.gz|tgz)/ 155 | cmd = shell_out( 156 | %Q[ tar xvzf "#{Chef::Config[:file_cache_path]}/#{tarball_name}" -C "#{Chef::Config[:file_cache_path]}" ] 157 | ) 158 | unless cmd.exitstatus == 0 159 | Chef::Application.fatal!("Failed to extract file #{tarball_name}!") 160 | end 161 | end 162 | 163 | cmd = shell_out( 164 | %Q[ mv "#{Chef::Config[:file_cache_path]}/#{app_dir_name}" "#{app_dir}" ] 165 | ) 166 | unless cmd.exitstatus == 0 167 | Chef::Application.fatal!(%Q[ Command \' mv "#{Chef::Config[:file_cache_path]}/#{app_dir_name}" "#{app_dir}" \' failed ]) 168 | end 169 | 170 | # change ownership of extracted files 171 | FileUtils.chown_R new_resource.owner, new_resource.owner, app_root 172 | end 173 | new_resource.updated_by_last_action(true) 174 | end 175 | 176 | #set up .jinfo file for update-java-alternatives 177 | java_name = app_home.split('/')[-1] 178 | jinfo_file = "#{app_root}/.#{java_name}.jinfo" 179 | if platform_family?("debian") && !::File.exists?(jinfo_file) 180 | description = "Add #{jinfo_file} for debian" 181 | converge_by(description) do 182 | Chef::Log.debug "Adding #{jinfo_file} for debian" 183 | template jinfo_file do 184 | cookbook "java" 185 | source "oracle.jinfo.erb" 186 | variables( 187 | :priority => new_resource.alternatives_priority, 188 | :bin_cmds => new_resource.bin_cmds, 189 | :name => java_name, 190 | :app_dir => app_home 191 | ) 192 | action :create 193 | end 194 | end 195 | new_resource.updated_by_last_action(true) 196 | end 197 | 198 | #link app_home to app_dir 199 | Chef::Log.debug "app_home is #{app_home} and app_dir is #{app_dir}" 200 | current_link = ::File.symlink?(app_home) ? ::File.readlink(app_home) : nil 201 | if current_link != app_dir 202 | description = "Symlink #{app_dir} to #{app_home}" 203 | converge_by(description) do 204 | Chef::Log.debug "Symlinking #{app_dir} to #{app_home}" 205 | FileUtils.rm_f app_home 206 | FileUtils.ln_sf app_dir, app_home 207 | end 208 | end 209 | 210 | #update-alternatives 211 | java_alternatives 'set-java-alternatives' do 212 | java_location app_home 213 | bin_cmds new_resource.bin_cmds 214 | priority new_resource.alternatives_priority 215 | default new_resource.default 216 | action :set 217 | end 218 | end 219 | 220 | action :remove do 221 | app_dir_name, tarball_name = parse_app_dir_name(new_resource.url) 222 | app_root = new_resource.app_home.split('/')[0..-2].join('/') 223 | app_dir = app_root + '/' + app_dir_name 224 | 225 | unless new_resource.default 226 | Chef::Log.debug("processing alternate jdk") 227 | app_dir = app_dir + "_alt" 228 | app_home = new_resource.app_home + "_alt" 229 | else 230 | app_home = new_resource.app_home 231 | end 232 | 233 | if ::File.exists?(app_dir) 234 | java_alternatives 'unset-java-alternatives' do 235 | java_location app_home 236 | bin_cmds new_resource.bin_cmds 237 | action :unset 238 | end 239 | description = "remove #{new_resource.name} at #{app_dir}" 240 | converge_by(description) do 241 | Chef::Log.info "Removing #{new_resource.name} at #{app_dir}" 242 | FileUtils.rm_rf app_dir 243 | end 244 | new_resource.updated_by_last_action(true) 245 | end 246 | end 247 | -------------------------------------------------------------------------------- /chef/supermarket/java/LICENSE: -------------------------------------------------------------------------------- 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. 202 | -------------------------------------------------------------------------------- /chef/supermarket/tomcat_latest/LICENSE: -------------------------------------------------------------------------------- 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. 202 | -------------------------------------------------------------------------------- /chef/supermarket/java/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Java Cookbook CHANGELOG 2 | ======================= 3 | This file is used to list changes made in each version of the Java cookbook. 4 | 5 | v1.25.0 - 8/1/2014 6 | ------- 7 | ### Improvement 8 | - **[#189](https://github.com/agileorbit-cookbooks/java/pull/189)** - Resource ark -> attribute bin_cmds default value 9 | - **[#168](https://github.com/agileorbit-cookbooks/java/pull/168)** - Add option to put JAVA_HOME in /etc/environment 10 | - **[#172](https://github.com/agileorbit-cookbooks/java/pull/172)** - Allow ark to pull from http and files ending in .gz. 11 | 12 | ### Documentation 13 | - Recommendations for inclusion in community cookbooks 14 | - Production Deployment with Oracle Java 15 | - Update testing instructions for chefdk 16 | - Various Readme formatting. 17 | 18 | ### Misc 19 | - Use Supermarket endpoint in berksfile 20 | - rspec cleanup 21 | - Adding ubuntu-14.04 to test suite 22 | 23 | v1.24.0 - 7/25/2014 24 | ------- 25 | New Cookbook maintainer! **[Agile Orbit](http://agileorbit.com)** 26 | 27 | ### Improvement 28 | - **[#192](https://github.com/agileorbit-cookbooks/java/pull/192)** - Bump JDK7 URLs to 7u65 29 | - **[#191](https://github.com/agileorbit-cookbooks/java/pull/192)** - Upgrade Oracle's Java 8 to u11 30 | - **[#188](https://github.com/agileorbit-cookbooks/java/pull/188)** - Allow for alternatives priority to be set from attribute. 31 | - **[#176](https://github.com/agileorbit-cookbooks/java/pull/176)** - Change ownership of extracted files 32 | - **[#169](https://github.com/agileorbit-cookbooks/java/pull/169)** - Add retries and retry_delay parameters to java_ark LWRP 33 | - **[#167](https://github.com/agileorbit-cookbooks/java/pull/167)** - default: don't fail when using java 8 on windows 34 | - **[#165](https://github.com/agileorbit-cookbooks/java/pull/165)** - Support for Server JRE 35 | - **[#158](https://github.com/agileorbit-cookbooks/java/pull/158)** - Updated README for accepting oracle terms 36 | - **[#157](https://github.com/agileorbit-cookbooks/java/pull/157)** -Remove VirtualBox specific box_urls 37 | - List AgileOrbit as the maintainer (AgileOrbit took over from Socrata in July 2014) 38 | 39 | v1.23.0 - 7/25/2014 40 | ------- 41 | - Tagged but never published to community cookbooks. All changes rolled into 1.24.0 42 | 43 | v1.22.0 44 | ------- 45 | ### Improvement 46 | - **[#148](https://github.com/socrata-cookbooks/java/pull/148)** - Add support for Oracle JDK 1.8.0 47 | - **[#150](https://github.com/socrata-cookbooks/java/pull/150)** - Make use of Chef's cache directory instead of /tmp 48 | - **[#151](https://github.com/socrata-cookbooks/java/pull/151)** - Update Test Kitchen suites 49 | - **[#154](https://github.com/socrata-cookbooks/java/pull/154)** - Add safety check for JDK 8 on non-Oracle 50 | 51 | v1.21.2 52 | ------- 53 | ### Bug 54 | - **[#146](https://github.com/socrata-cookbooks/java/pull/146)** - Update Oracle accept-license-terms cookie format 55 | 56 | v1.21.0 57 | ------- 58 | ### Improvement 59 | - **[#143](https://github.com/socrata-cookbooks/java/pull/143)** - Symlink /usr/lib/jvm/default-java for both OpenJDK and Oracle 60 | - **[#144](https://github.com/socrata-cookbooks/java/pull/144)** - Remove /var/lib/alternatives/#{cmd} before calling alternatives (Hopefully fixes sporadic issues when setting alternatives) 61 | - **[Make default_java_symlink conditional on set_default attribute](https://github.com/socrata-cookbooks/java/commit/e300e235a463382a5022e1dddaac674930b4d138)** 62 | 63 | v1.20.0 64 | ------- 65 | ### Improvement 66 | - **[#137](https://github.com/socrata-cookbooks/java/pull/137)** - Create /usr/lib/jvm/default-java on Debian 67 | - **[#138](https://github.com/socrata-cookbooks/java/pull/138)** - allow wrapping cookbook without providing templates 68 | - **[#140](https://github.com/socrata-cookbooks/java/pull/140)** - Adds set_default attribute to toggle setting JDK as default 69 | 70 | ### Bug 71 | - **[#141](https://github.com/socrata-cookbooks/java/pull/141)** - set java_home correctly for oracle_rpm 72 | 73 | v1.19.2 74 | ------- 75 | ### Improvement 76 | - **[#129](https://github.com/socrata-cookbooks/java/pull/129)** - Upgrade to ChefSpec 3 77 | - Rewrite unit tests for better coverage and to work with ChefSpec 3 (various commits) 78 | - List Socrata as the maintainer (Socrata took over from Opscode in December 2013) 79 | 80 | ### Bug 81 | - **[#133](https://github.com/socrata-cookbooks/java/pull/133)** - Allow jdk_version to be a string or number 82 | - **[#131](https://github.com/socrata-cookbooks/java/pull/131)** - Fix JDK install on Windows 83 | - **[Fix openjdk_packages on Arch Linux](https://github.com/socrata-cookbooks/java/commit/677bee7b9bf08988596d40ac65e75984a86bda99)** 84 | 85 | v1.19.0 86 | ------- 87 | Refactor the cookbook to better support wrapper cookbooks and other cookbook authoring patterns. 88 | ### Improvement 89 | - **[#123](https://github.com/socrata-cookbooks/java/pull/123)** - Update documentation & add warning for issue 122 90 | - **[#124](https://github.com/socrata-cookbooks/java/pull/124)** - Refactor default recipe to better enable wrapper cookbooks 91 | - **[#125](https://github.com/socrata-cookbooks/java/pull/125)** - Removes the attribute to purge deprecated packages 92 | - **[#127](https://github.com/socrata-cookbooks/java/pull/127)** - Add safety check if attributes are unset 93 | - **[Adds tests for directly using openjdk and oracle recipes](https://github.com/socrata-cookbooks/java/commit/794df596959d65a1a6d5f6c52688bffd8de6bff4)** 94 | - **[Adds recipes to README](https://github.com/socrata-cookbooks/java/commit/76d52114bb9df084174d43fed143123b1cdbae16)** 95 | - **[The Opscode CCLA is no longer required](https://github.com/socrata-cookbooks/java/commit/ce4ac25caa8383f185c25c4e32cafef8c0453376)** 96 | - **[Adds tests for openjdk-7 and oracle-7](https://github.com/socrata-cookbooks/java/commit/9c38af241f68b3198cde4ad6fe2b4cb752062009)** 97 | 98 | 99 | ### Bug 100 | - **[#119](https://github.com/socrata-cookbooks/java/pull/119)** - Use java_home instead of java_location for update-alternatives 101 | - **[Fix java_home for rhel and fedora](https://github.com/socrata-cookbooks/java/commit/71dadbd1bfe2eab50ff21cdab4ded97877911cc4)** 102 | 103 | v1.18.0 104 | ------- 105 | ### Improvement 106 | - **[#118](https://github.com/socrata-cookbooks/java/pull/118)** - Upgrade to 7u51 107 | - **[#117](https://github.com/socrata-cookbooks/java/pull/117)** - Suggest windows and aws 108 | 109 | v1.17.6 110 | ------- 111 | ### Bug 112 | - Revert **[COOK-4165](https://tickets.opscode.com/browse/COOK-4165)** - The headers option was only added to remote_file in Chef 11.6.0, meaning this change breaks older clients. 113 | 114 | v1.17.4 115 | ------- 116 | ### Bug 117 | - **[#111](https://github.com/socrata-cookbooks/java/pull/111)** - Fix alternatives for centos 118 | 119 | ### Improvement 120 | - **[COOK-4165](https://tickets.opscode.com/browse/COOK-4165)** - Replace curl with remote_file with cookie header 121 | - **[#110](https://github.com/socrata-cookbooks/java/pull/110)** - Update openjdk to use the alternatives resource 122 | 123 | v1.17.2 124 | ------- 125 | ### Bug 126 | - **[COOK-4136](https://tickets.opscode.com/browse/COOK-4136)** - Add md5 parameter to java_ark resource 127 | 128 | 129 | v1.17.0 130 | ------- 131 | - **[COOK-4114](https://tickets.opscode.com/browse/COOK-4114)** - Test Kitchen no longer works after merging Pull Request #95 for openjdk tests on Debian/Ubuntu 132 | - **[COOK-4124](https://tickets.opscode.com/browse/COOK-4124)** - update-alternatives fails to run 133 | - **[#81](https://github.com/socrata/java/pull/81)** - Ensure local directory hierarchy 134 | - **[#97](https://github.com/socrata/java/pull/97)** - Expose LWRP state attributes 135 | - **[#99](https://github.com/socrata/java/pull/99)** - support for MD5 checksum 136 | - **[#106](https://github.com/socrata/java/pull/106)** - Fixed windows case to prevent bad java_home variable setting 137 | - **[Update checksums to the officially-published ones from Oracle](https://github.com/socrata/java/commit/b9e1df24caeb6e22346d2d415b3b4384f15d4ffd)** 138 | - **[Further test kitchen fixes to use the default recipe](https://github.com/socrata/java/commit/01c0b432705d9cfa6d2dfeaa380983e3f604069f)** 139 | 140 | v1.16.4 141 | ------- 142 | ### Bug 143 | - **[#103](https://github.com/socrata/java/pull/103)** - set alternatives when using ibm_tar recipe 144 | - **[#104](https://github.com/socrata/java/pull/104)** - Specify windows attributes in attribute files 145 | 146 | v1.16.2 147 | ------- 148 | ### Improvement 149 | - **[COOK-3488](https://tickets.opscode.com/browse/COOK-3488)** - set alternatives for ibm jdk 150 | - **[COOK-3764](https://tickets.opscode.com/browse/COOK-3764)** - IBM Java installer needs 'rpm' package on Ubuntu 151 | 152 | ### Bug 153 | - **[COOK-3857](https://tickets.opscode.com/browse/COOK-3857)** - do not unescape the java windows url before parsing it 154 | - **[#95](https://github.com/socrata/java/pull/95)** - fixes update-alternatives for openjdk installs 155 | - **[#100](https://github.com/socrata/java/pull/100)** - Use escaped quotes for Windows INSTALLDIR 156 | 157 | 158 | v1.16.0 159 | ------- 160 | ### Improvement 161 | - **[COOK-3823](https://tickets.opscode.com/browse/COOK-3823)** - Upgrade to JDK 7u45-b18 162 | 163 | v1.15.4 164 | ------- 165 | [COOK-4210] - remove unneeded run_command to prevent zombie processes 166 | 167 | 168 | v1.15.2 169 | ------- 170 | [CHEF-4210] remove unneeded run_command to prevent zombie processes 171 | 172 | 173 | v1.15.0 174 | ------- 175 | ### Bug 176 | - Fixing version number. Accidently released at 0.15.x instead of 1.15.x 177 | 178 | 179 | v0.15.2 180 | ------- 181 | ### FIX 182 | - [COOK-3908] - Fixing JAVA_HOME on Ubuntu 10.04 183 | 184 | 185 | v1.14.0 186 | ------- 187 | ### Bug 188 | - **[COOK-3704](https://tickets.opscode.com/browse/COOK-3704)** - Fix alternatives when the package is already installed 189 | - **[COOK-3668](https://tickets.opscode.com/browse/COOK-3668)** - Fix a condition that would result in an error executing action `run` on resource 'bash[update-java-alternatives]' 190 | - **[COOK-3569](https://tickets.opscode.com/browse/COOK-3569)** - Fix bad checksum length 191 | - **[COOK-3541](https://tickets.opscode.com/browse/COOK-3541)** - Fix an issue where Java cookbook installs both JDK 6 and JDK 7 when JDK 7 is specified 192 | - **[COOK-3518](https://tickets.opscode.com/browse/COOK-3518)** - Allow Windoes recipe to download from signed S3 url 193 | - **[COOK-2996](https://tickets.opscode.com/browse/COOK-2996)** - Fix a failure on Centos 6.4 and Oracle JDK 7 194 | 195 | ### Improvement 196 | - **[COOK-2793](https://tickets.opscode.com/browse/COOK-2793)** - Improve Windows support 197 | 198 | 199 | v1.13.0 200 | ------- 201 | ### Bug 202 | - **[COOK-3295](https://tickets.opscode.com/browse/COOK-3295)** - Add default `platform_family` option in Java helper 203 | - **[COOK-3277](https://tickets.opscode.com/browse/COOK-3277)** - Fix support for Fedora 204 | 205 | ### Improvement 206 | - **[COOK-3278](https://tickets.opscode.com/browse/COOK-3278)** - Upgrade to Oracle Java 7u25 207 | - **[COOK-3029](https://tickets.opscode.com/browse/COOK-3029)** - Add Oracle RPM support 208 | - **[COOK-2931](https://tickets.opscode.com/browse/COOK-2931)** - Add support for the platform `xenserver` 209 | - **[COOK-2154](https://tickets.opscode.com/browse/COOK-2154)** - Add SmartOS support 210 | 211 | v1.12.0 212 | ------- 213 | ### Improvement 214 | - [COOK-2154]: Add SmartOS support to java::openjdk recipe 215 | - [COOK-3278]: upgrade to Oracle Java 7u25 216 | 217 | ### Bug 218 | - [COOK-2931]: Adding support for the platform 'xenserver' (for installations of java in DOM0) 219 | - [COOK-3277]: java cookbook fails on Fedora 220 | 221 | v1.11.6 222 | ------- 223 | ### Bug 224 | - [COOK-2847]: Java cookbook does not have opensuse support 225 | - [COOK-3142]: Syntax Errors spec/default_spec.rb:4-8 226 | 227 | v1.11.4 228 | ------- 229 | ### Bug 230 | - [COOK-2989]: `bash[update-java-alternatives]` resource uses wrong attribute 231 | 232 | v1.11.2 233 | ------- 234 | ### Bug 235 | - Use SHA256 checksums for Oracle downloads, not SHA1. 236 | 237 | v1.11.0 238 | ------- 239 | This version brings a wealth of tests and (backwards-compatible) refactoring, plus some new features (updated Java, IBM recipe). 240 | 241 | ### Sub-task 242 | - [COOK-2897]: Add ibm recipe to java cookbook 243 | - [COOK-2903]: move java_home resources to their own recipe 244 | - [COOK-2904]: refactor ruby_block "update-java-alternatives" 245 | - [COOK-2905]: use platform_family in java cookbook 246 | - [COOK-2920]: add chefspec to java cookbook 247 | 248 | ### Task 249 | - [COOK-2902]: Refactor java cookbook 250 | 251 | ### Improvement 252 | - [COOK-2900]: update JDK to JDK 7u21, 6u45 253 | 254 | v1.10.2 255 | ------- 256 | - [COOK-2415] - Fixed deprecation warnings in ark provider and openjdk recipe by using Chef::Mixin::ShellOut instead of Chef::ShellOut 257 | 258 | v1.10.0 259 | ------- 260 | - [COOK-2400] - Allow java ark :url to be https 261 | - [COOK-2436] - Upgrade needed for oracle jdk in java cookbook 262 | 263 | v1.9.6 264 | ------ 265 | - [COOK-2412] - add support for Oracle Linux 266 | 267 | v1.9.4 268 | ------ 269 | - [COOK-2083] - Run set-env-java-home in Java cookbook only if necessary 270 | - [COOK-2332] - ark provider does not allow for *.tgz tarballs to be used 271 | - [COOK-2345] - Java cookbook fails on CentOS6 (update-java-alternatives) 272 | 273 | v1.9.2 274 | ------ 275 | - [COOK-2306] - FoodCritic fixes for java cookbook 276 | 277 | v1.9.0 278 | ------ 279 | - [COOK-2236] - Update the Oracle Java version in the Java cookbook to release 1.7u11 280 | 281 | v1.8.2 282 | ------ 283 | - [COOK-2205] - Fix for missing /usr/lib/jvm/default-java on Debian 284 | 285 | v1.8.0 286 | ------ 287 | - [COOK-2095] - Add windows support 288 | 289 | v1.7.0 290 | ------ 291 | - [COOK-2001] - improvements for Oracle update-alternatives 292 | - When installing an Oracle JDK it is now registered with a higher 293 | priority than OpenJDK. (Related to COOK-1131.) 294 | - When running both the oracle and oracle_i386 recipes, alternatives 295 | are now created for both JDKs. 296 | - Alternatives are now created for all binaries listed in version 297 | specific attributes. (Related to COOK-1563 and COOK-1635.) 298 | - When installing Oracke JDKs on Ubuntu, create .jinfo files for use 299 | with update-java-alternatives. Commands to set/install 300 | alternatives now only run if needed. 301 | 302 | v1.6.4 303 | ------ 304 | - [COOK-1930] - fixed typo in attribute for java 5 on i586 305 | 306 | v1.6.2 307 | ------ 308 | - whyrun support in `java_ark` LWRP 309 | - CHEF-1804 compatibility 310 | - [COOK-1786]- install Java 6u37 and Java 7u9 311 | - [COOK-1819] -incorrect warning text about `node['java']['oracle']['accept_oracle_download_terms']` 312 | 313 | v1.6.0 314 | ------ 315 | - [COOK-1218] - Install Oracle JDK from Oracle download directly 316 | - [COOK-1631] - set JAVA_HOME in openjdk recipe 317 | - [COOK-1655] - Install correct architecture on Amazon Linux 318 | 319 | v1.5.4 320 | ------ 321 | - [COOK-885] - update alternatives called on wrong file 322 | - [COOK-1607] - use shellout instead of execute resource to update alternatives 323 | 324 | v1.5.2 325 | ------ 326 | - [COOK-1200] - remove sun-java6-jre on Ubuntu before installing Oracle's Java 327 | - [COOK-1260] - fails on Ubuntu 12.04 64bit with openjdk7 328 | - [COOK-1265] - Oracle Java should symlink the jar command 329 | 330 | v1.5.0 331 | ------ 332 | - [COOK-1146] - Oracle now prevents download of JDK via non-browser 333 | - [COOK-1114] - fix File.exists? 334 | 335 | v1.4.2 336 | ------ 337 | - [COOK-1051] - fix attributes typo and platform case switch consistency 338 | 339 | v1.4.0 340 | ------ 341 | - [COOK-858] - numerous updates: handle jdk6 and 7, switch from sun to oracle, make openjdk default, add `java_ark` LWRP. 342 | - [COOK-942] - FreeBSD support 343 | - [COOK-520] - ArchLinux support 344 | -------------------------------------------------------------------------------- /chef/supermarket/java/README.md: -------------------------------------------------------------------------------- 1 | java 2 | ===== 3 | 4 | This cookbook installs a Java JDK/JRE. It defaults to installing 5 | OpenJDK, but it can also install Oracle and IBM JDKs. 6 | 7 | Usage 8 | ----- 9 | 10 | Simply include the `java` recipe wherever you would like Java installed, such as a run list (`recipe[java]`) or a cookbook (`include_recipe 'java'`). By default, OpenJDK 6 is installed. The `install_flavor` attribute is used to determine which JDK to install (OpenJDK, Oracle, IBM, or Windows), and `jdk_version` specifies which version to install (currently 6 and 7 are supported for all JDK types, 8 for Oracle only). 11 | 12 | ### Examples 13 | 14 | To install Oracle Java 7 (note that when installing Oracle JDK, `accept_oracle_download_terms` must be set -- see below for details): 15 | ```ruby 16 | name "java" 17 | description "Install Oracle Java" 18 | default_attributes( 19 | "java" => { 20 | "install_flavor" => "oracle", 21 | "jdk_version" => "7", 22 | "oracle" => { 23 | "accept_oracle_download_terms" => true 24 | } 25 | } 26 | ) 27 | run_list( 28 | "recipe[java]" 29 | ) 30 | ``` 31 | 32 | To install IBM flavored Java: 33 | ```ruby 34 | name "java" 35 | description "Install IBM Java on Ubuntu" 36 | default_attributes( 37 | "java" => { 38 | "install_flavor" => "ibm", 39 | "ibm" => { 40 | "accept_ibm_download_terms" => true, 41 | "url" => "http://fileserver.example.com/ibm-java-x86_64-sdk-7.0-4.1.bin", 42 | "checksum" => "The SHA256 checksum of the bin" 43 | } 44 | } 45 | ) 46 | run_list( 47 | "recipe[java]" 48 | ) 49 | ``` 50 | 51 | Requirements 52 | ----- 53 | 54 | Chef 0.10.10+ and Ohai 6.10+ for `platform_family` use. 55 | 56 | ### Platform 57 | 58 | * Debian, Ubuntu 59 | * CentOS, Red Hat, Fedora, Scientific, Amazon, XenServer 60 | * ArchLinux 61 | * FreeBSD 62 | * SmartOS 63 | * Windows 64 | 65 | Attributes 66 | ----- 67 | 68 | See `attributes/default.rb` for default values. 69 | 70 | * `node['java']['install_flavor']` - Flavor of JVM you would like 71 | installed (`oracle`, `openjdk`, `ibm`, `windows`), default `openjdk` 72 | on Linux/Unix platforms, `windows` on Windows platforms. 73 | * `node['java']['jdk_version']` - JDK version to install, defaults to 74 | `'6'`. 75 | * `node['java']['java_home']` - Default location of the 76 | "`$JAVA_HOME`". 77 | * `node['java']['set_etc_environment']` - Optionally sets 78 | JAVA_HOME in `/etc/environment` for Default `false`. 79 | * `node['java']['openjdk_packages']` - Array of OpenJDK package names 80 | to install in the `java::openjdk` recipe. This is set based on the 81 | platform. 82 | * `node['java']['tarball']` - Name of the tarball to retrieve from 83 | your internal repository, default `jdk1.6.0_29_i386.tar.gz` 84 | * `node['java']['tarball_checksum']` - Checksum for the tarball, if 85 | you use a different tarball, you also need to create a new sha256 86 | checksum 87 | * `node['java']['jdk']` - Version and architecture specific attributes 88 | for setting the URL on Oracle's site for the JDK, and the checksum of 89 | the .tar.gz. 90 | * `node['java']['oracle']['accept_oracle_download_terms']` - Indicates 91 | that you accept Oracle's EULA 92 | * `node['java']['windows']['url']` - The internal location of your 93 | java install for windows 94 | * `node['java']['windows']['package_name']` - The package name used by 95 | windows_package to check in the registry to determine if the install 96 | has already been run 97 | * `node['java']['windows']['checksum']` - The checksum for the package to 98 | download on Windows machines (default is nil, which does not perform 99 | checksum validation) 100 | * `node['java']['ibm']['url']` - The URL which to download the IBM 101 | JDK/SDK. See the `ibm` recipe section below. 102 | * `node['java']['ibm']['accept_ibm_download_terms']` - Indicates that 103 | you accept IBM's EULA (for `java::ibm`) 104 | * `node['java']['accept_license_agreement']` - Indicates that you accept 105 | the EULA for openjdk package installation. 106 | * `node['java']['set_default']` - Indicates whether or not you want the 107 | JDK installed to be default on the system. Defaults to true. 108 | 109 | Recipes 110 | ----- 111 | 112 | ### default 113 | 114 | Include the default recipe in a run list or recipe to get `java`. By default 115 | the `openjdk` flavor of Java is installed, but this can be changed by 116 | using the `install_flavor` attribute. By default on Windows platform 117 | systems, the `install_flavor` is `windows`. 118 | 119 | OpenJDK is the default because of licensing changes made upstream by 120 | Oracle. See notes on the `oracle` recipe below. 121 | 122 | NOTE: In most cases, including just the default recipe will be sufficient. 123 | It's possible to include the install_type recipes directly, as long as 124 | the necessary attributes (such as java_home) are set. 125 | 126 | ### set_attributes_from_version 127 | 128 | Sets default attributes based on the JDK version. This is included by `default.rb`. This logic must be in 129 | a recipe instead of attributes/default.rb. See [#95](https://github.com/agileorbit-cookbooks/java/pull/95) 130 | for details. 131 | 132 | ### default_java_symlink 133 | 134 | Updates /usr/lib/jvm/default-java to point to JAVA_HOME. 135 | 136 | ### purge_packages 137 | 138 | Purges deprecated Sun Java packages. 139 | 140 | ### openjdk 141 | 142 | This recipe installs the `openjdk` flavor of Java. It also uses the 143 | `alternatives` system on RHEL/Debian families to set the default Java. 144 | 145 | On platforms such as SmartOS that require the acceptance of a license 146 | agreement during package installation, set 147 | `node['java']['accept_license_agreement']` to true in order to indicate 148 | that you accept the license. 149 | 150 | ### oracle 151 | 152 | This recipe installs the `oracle` flavor of Java. This recipe does not 153 | use distribution packages as Oracle changed the licensing terms with 154 | JDK 1.6u27 and prohibited the practice for both RHEL and Debian family 155 | platforms. 156 | 157 | As of 26 March 2012 you can no longer directly download the JDK from 158 | Oracle's website without using a special cookie. This cookbook uses 159 | that cookie to download the oracle recipe on your behalf, however the 160 | `java::oracle` recipe forces you to set either override the 161 | `node['java']['oracle']['accept_oracle_download_terms']` to true or 162 | set up a private repository accessible by HTTP. 163 | 164 | override the `accept_oracle_download_terms` in, e.g., `roles/base.rb` 165 | ```ruby 166 | default_attributes( 167 | :java => { 168 | :oracle => { 169 | "accept_oracle_download_terms" => true 170 | } 171 | } 172 | ) 173 | ``` 174 | 175 | For both RHEL and Debian families, this recipe pulls the binary 176 | distribution from the Oracle website, and installs it in the default 177 | `JAVA_HOME` for each distribution. For Debian, this is 178 | `/usr/lib/jvm/default-java`. For RHEl, this is `/usr/lib/jvm/java`. 179 | 180 | After putting the binaries in place, the `java::oracle` recipe updates 181 | `/usr/bin/java` to point to the installed JDK using the 182 | `update-alternatives` script. This is all handled in the `java_ark` 183 | LWRP. 184 | 185 | ### oracle_i386 186 | 187 | This recipe installs the 32-bit Java virtual machine without setting 188 | it as the default. This can be useful if you have applications on the 189 | same machine that require different versions of the JVM. 190 | 191 | This recipe operates in a similar manner to `java::oracle`. 192 | 193 | ### oracle_rpm 194 | 195 | This recipe installs the Oracle JRE or JDK provided by a custom YUM 196 | repositories. 197 | It also uses the `alternatives` system on RHEL families to set 198 | the default Java. 199 | 200 | ### windows 201 | 202 | Because there is no easy way to pull the java msi off oracle's site, 203 | this recipe requires you to host it internally on your own http repo. 204 | 205 | **IMPORTANT NOTE** 206 | 207 | If you use the `windows` recipe, you'll need to make sure you've uploaded 208 | the `aws` and `windows` cookbooks. As of version 1.18.0, this cookbook 209 | references them with `suggests` instead of `depends`, as they are only 210 | used by the `windows` recipe. 211 | 212 | ### ibm 213 | 214 | The `java::ibm` recipe is used to install the IBM version of Java. 215 | Note that IBM requires you to create an account *and* log in to 216 | download the binary installer for your platform. You must accept the 217 | license agreement with IBM to use their version of Java. In this 218 | cookbook, you indicate this by setting 219 | `node['java']['ibm']['accept_ibm_download_terms']` to `true`. You must 220 | also host the binary on your own HTTP server to have an automated 221 | installation. The `node['java']['ibm']['url']` attribute must be set 222 | to a valid https/http URL; the URL is checked for validity in the recipe. 223 | 224 | At this time the `java::ibm` recipe does not support multiple SDK 225 | installations. 226 | 227 | Resources/Providers 228 | ----- 229 | 230 | ### java_ark 231 | 232 | This cookbook contains the `java_ark` LWRP. Generally speaking this 233 | LWRP is deprecated in favor of `ark` from the 234 | [ark cookbook](https://github.com/opscode-cookbooks/ark), but it is 235 | still used in this cookbook for handling the Oracle JDK installation. 236 | 237 | By default, the extracted directory is extracted to 238 | `app_root/extracted_dir_name` and symlinked to `app_root/default` 239 | 240 | #### Actions 241 | 242 | - `:install`: extracts the tarball and makes necessary symlinks 243 | - `:remove`: removes the tarball and run update-alternatives for all 244 | symlinked `bin_cmds` 245 | 246 | #### Attribute Parameters 247 | 248 | - `url`: path to tarball, .tar.gz, .bin (oracle-specific), and .zip 249 | currently supported 250 | - `checksum`: SHA256 checksum, not used for security but avoid 251 | redownloading the archive on each chef-client run 252 | - `app_home`: the default for installations of this type of 253 | application, for example, `/usr/lib/tomcat/default`. If your 254 | application is not set to the default, it will be placed at the same 255 | level in the directory hierarchy but the directory name will be 256 | `app_root/extracted_directory_name + "_alt"` 257 | - `app_home_mode`: file mode for app_home, is an integer 258 | - `bin_cmds`: array of binary commands that should be symlinked to 259 | `/usr/bin`, examples are mvn, java, javac, etc. These cmds must be in 260 | the `bin` subdirectory of the extracted folder. Will be ignored if this 261 | `java_ark` is not the default 262 | - `owner`: owner of extracted directory, set to "root" by default 263 | - `default`: whether this the default installation of this package, 264 | boolean true or false 265 | 266 | #### Examples 267 | ```ruby 268 | # install jdk6 from Oracle 269 | java_ark "jdk" do 270 | url 'http://download.oracle.com/otn-pub/java/jdk/6u29-b11/jdk-6u29-linux-x64.bin' 271 | checksum 'a8603fa62045ce2164b26f7c04859cd548ffe0e33bfc979d9fa73df42e3b3365' 272 | app_home '/usr/local/java/default' 273 | bin_cmds ["java", "javac"] 274 | action :install 275 | end 276 | ``` 277 | ### java_alternatives 278 | 279 | The `java_alternatives` LWRP uses `update-alternatives` command 280 | to set and unset command alternatives for various Java tools 281 | such as java, javac, etc. 282 | 283 | #### Actions 284 | 285 | - `:set`: set alternatives for Java tools 286 | - `:unset`: unset alternatives for Java tools 287 | 288 | #### Attribute Parameters 289 | 290 | - `java_location`: Java installation location. 291 | - `bin_cmds`: array of Java tool names to set or unset alternatives on. 292 | - `default`: whether to set the Java tools as system default. Boolean, defaults to `true`. 293 | - `priority`: priority of the alternatives. Integer, defaults to `1061`. 294 | 295 | #### Examples 296 | ```ruby 297 | # set alternatives for java and javac commands 298 | java_alternatives "set java alternatives" do 299 | java_location '/usr/local/java' 300 | bin_cmds ["java", "javac"] 301 | action :set 302 | end 303 | ``` 304 | 305 | Production Deployment with Oracle Java 306 | ----- 307 | Oracle has been known to change the behavior of its download site frequently. It is recommended you store the archives on an artifact server or s3 bucket. You can then override the attributes in a cookbook, role, or environment: 308 | 309 | ```ruby 310 | default['java']['jdk_version'] = '7' 311 | default['java']['install_flavor'] = 'oracle' 312 | default['java']['jdk']['7']['x86_64']['url'] = 'http://artifactory.example.com/artifacts/jdk-7u65-linux-x64.tar.gz' 313 | default['java']['oracle']['accept_oracle_download_terms'] = true 314 | ``` 315 | 316 | Recommendations for inclusion in community cookbooks 317 | ----- 318 | 319 | This cookbook is a dependency for many other cookbooks in the Java/Chef sphere. Here are some guidelines for including it into other cookbooks: 320 | 321 | ### Allow people to not use this cookbook 322 | Many users manage Java on their own or have systems that already have java installed. Give these users an option to skip this cookbook, for example: 323 | ```ruby 324 | include_recipe 'java' if node['maven']['install_java'] 325 | ``` 326 | 327 | This would allow a users of the maven cookbook to choose if they want the maven cookbook to install java for them or leave that up to the consumer. 328 | 329 | Another good example is from the [Jenkins Cookbook Java recipe](https://github.com/opscode-cookbooks/jenkins/commit/ca2a69d982011dc1bec6a6d0ee4da5c1a1599864). 330 | 331 | ### Pinning to major version of cookbook and Java 332 | This cookbook follows semver. It is recommended to pin at the major version of this cookbook when including it in other cookbooks, eg: `depends 'java', '~> 1.0'` 333 | 334 | It is acceptable to set the `node['java']['jdk_version']` to a specific version if required for your software to run, eg software xyz requires Java 8 to run. Refrain from pinning to specific patches of the JDK to allow users to consume security updates. 335 | 336 | Development 337 | ----- 338 | 339 | This cookbook uses 340 | [test-kitchen](https://github.com/opscode/test-kitchen) for 341 | integration tests and 342 | [ChefSpec/RSpec](https://github.com/sethvargo/chefspec) for unit tests. 343 | See [TESTING.md](https://github.com/agileorbit-cookbooks/java/blob/master/TESTING.md) for testing instructions. 344 | 345 | At this time due to licensing concerns, the IBM recipe is not set up 346 | in test kitchen. If you would like to test this locally, copy 347 | .kitchen.yml to .kitchen.local.yml and add the following suite: 348 | ```yml 349 | suites: 350 | - name: ibm 351 | run_list: ["recipe[java]"] 352 | attributes: 353 | java: 354 | install_flavor: "ibm" 355 | ibm: 356 | accept_ibm_download_terms: true 357 | url: "http://jenkins/ibm-java-x86_64-sdk-7.0-4.1.bin" 358 | checksum: the-sha256-checksum 359 | ``` 360 | 361 | Log into the IBM DeveloperWorks site to download a copy of the IBM 362 | Java SDK you wish to use/test, host it on an internal HTTP server, and 363 | calculate the SHA256 checksum to use in the suite. 364 | 365 | License and Author 366 | ----- 367 | 368 | * Author: Seth Chisamore () 369 | * Author: Bryan W. Berry () 370 | * Author: Joshua Timberman () 371 | * Author: Eric Helgeson () 372 | 373 | Copyright: 2014, Agile Orbit, LLC 374 | 375 | Licensed under the Apache License, Version 2.0 (the "License"); 376 | you may not use this file except in compliance with the License. 377 | You may obtain a copy of the License at 378 | 379 | http://www.apache.org/licenses/LICENSE-2.0 380 | 381 | Unless required by applicable law or agreed to in writing, software 382 | distributed under the License is distributed on an "AS IS" BASIS, 383 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 384 | See the License for the specific language governing permissions and 385 | limitations under the License. 386 | -------------------------------------------------------------------------------- /chef/supermarket/java/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "java", 3 | "description": "Installs Java runtime.", 4 | "long_description": "java\n=====\n\nThis cookbook installs a Java JDK/JRE. It defaults to installing\nOpenJDK, but it can also install Oracle and IBM JDKs.\n\nUsage\n-----\n\nSimply include the `java` recipe wherever you would like Java installed, such as a run list (`recipe[java]`) or a cookbook (`include_recipe 'java'`). By default, OpenJDK 6 is installed. The `install_flavor` attribute is used to determine which JDK to install (OpenJDK, Oracle, IBM, or Windows), and `jdk_version` specifies which version to install (currently 6 and 7 are supported for all JDK types, 8 for Oracle only).\n\n### Examples\n\nTo install Oracle Java 7 (note that when installing Oracle JDK, `accept_oracle_download_terms` must be set -- see below for details):\n```ruby\nname \"java\"\ndescription \"Install Oracle Java\"\ndefault_attributes(\n \"java\" => {\n \"install_flavor\" => \"oracle\",\n \"jdk_version\" => \"7\",\n \"oracle\" => {\n \"accept_oracle_download_terms\" => true\n }\n }\n)\nrun_list(\n \"recipe[java]\"\n)\n```\n\nTo install IBM flavored Java:\n```ruby\nname \"java\"\ndescription \"Install IBM Java on Ubuntu\"\ndefault_attributes(\n \"java\" => {\n \"install_flavor\" => \"ibm\",\n \"ibm\" => {\n \"accept_ibm_download_terms\" => true,\n \"url\" => \"http://fileserver.example.com/ibm-java-x86_64-sdk-7.0-4.1.bin\",\n \"checksum\" => \"The SHA256 checksum of the bin\"\n }\n }\n)\nrun_list(\n \"recipe[java]\"\n)\n```\n\nRequirements\n-----\n\nChef 0.10.10+ and Ohai 6.10+ for `platform_family` use.\n\n### Platform\n\n* Debian, Ubuntu\n* CentOS, Red Hat, Fedora, Scientific, Amazon, XenServer\n* ArchLinux\n* FreeBSD\n* SmartOS\n* Windows\n\nAttributes\n-----\n\nSee `attributes/default.rb` for default values.\n\n* `node['java']['install_flavor']` - Flavor of JVM you would like\ninstalled (`oracle`, `openjdk`, `ibm`, `windows`), default `openjdk`\non Linux/Unix platforms, `windows` on Windows platforms.\n* `node['java']['jdk_version']` - JDK version to install, defaults to\n `'6'`.\n* `node['java']['java_home']` - Default location of the\n \"`$JAVA_HOME`\".\n* `node['java']['set_etc_environment']` - Optionally sets\n JAVA_HOME in `/etc/environment` for Default `false`.\n* `node['java']['openjdk_packages']` - Array of OpenJDK package names\n to install in the `java::openjdk` recipe. This is set based on the\n platform.\n* `node['java']['tarball']` - Name of the tarball to retrieve from\nyour internal repository, default `jdk1.6.0_29_i386.tar.gz`\n* `node['java']['tarball_checksum']` - Checksum for the tarball, if\nyou use a different tarball, you also need to create a new sha256\nchecksum\n* `node['java']['jdk']` - Version and architecture specific attributes\nfor setting the URL on Oracle's site for the JDK, and the checksum of\nthe .tar.gz.\n* `node['java']['oracle']['accept_oracle_download_terms']` - Indicates\n that you accept Oracle's EULA\n* `node['java']['windows']['url']` - The internal location of your\n java install for windows\n* `node['java']['windows']['package_name']` - The package name used by\n windows_package to check in the registry to determine if the install\n has already been run\n* `node['java']['windows']['checksum']` - The checksum for the package to\n download on Windows machines (default is nil, which does not perform\n checksum validation)\n* `node['java']['ibm']['url']` - The URL which to download the IBM\n JDK/SDK. See the `ibm` recipe section below.\n* `node['java']['ibm']['accept_ibm_download_terms']` - Indicates that\n you accept IBM's EULA (for `java::ibm`)\n* `node['java']['accept_license_agreement']` - Indicates that you accept\n the EULA for openjdk package installation.\n* `node['java']['set_default']` - Indicates whether or not you want the\n JDK installed to be default on the system. Defaults to true.\n\nRecipes\n-----\n\n### default\n\nInclude the default recipe in a run list or recipe to get `java`. By default\nthe `openjdk` flavor of Java is installed, but this can be changed by\nusing the `install_flavor` attribute. By default on Windows platform\nsystems, the `install_flavor` is `windows`.\n\nOpenJDK is the default because of licensing changes made upstream by\nOracle. See notes on the `oracle` recipe below.\n\nNOTE: In most cases, including just the default recipe will be sufficient.\nIt's possible to include the install_type recipes directly, as long as\nthe necessary attributes (such as java_home) are set.\n\n### set_attributes_from_version\n\nSets default attributes based on the JDK version. This is included by `default.rb`. This logic must be in\na recipe instead of attributes/default.rb. See [#95](https://github.com/agileorbit-cookbooks/java/pull/95)\nfor details.\n\n### default_java_symlink\n\nUpdates /usr/lib/jvm/default-java to point to JAVA_HOME.\n\n### purge_packages\n\nPurges deprecated Sun Java packages.\n\n### openjdk\n\nThis recipe installs the `openjdk` flavor of Java. It also uses the\n`alternatives` system on RHEL/Debian families to set the default Java.\n\nOn platforms such as SmartOS that require the acceptance of a license\nagreement during package installation, set\n`node['java']['accept_license_agreement']` to true in order to indicate\nthat you accept the license.\n\n### oracle\n\nThis recipe installs the `oracle` flavor of Java. This recipe does not\nuse distribution packages as Oracle changed the licensing terms with\nJDK 1.6u27 and prohibited the practice for both RHEL and Debian family\nplatforms.\n\nAs of 26 March 2012 you can no longer directly download the JDK from\nOracle's website without using a special cookie. This cookbook uses\nthat cookie to download the oracle recipe on your behalf, however the\n`java::oracle` recipe forces you to set either override the\n`node['java']['oracle']['accept_oracle_download_terms']` to true or\nset up a private repository accessible by HTTP.\n\noverride the `accept_oracle_download_terms` in, e.g., `roles/base.rb`\n```ruby\n default_attributes(\n :java => {\n :oracle => {\n \"accept_oracle_download_terms\" => true\n }\n }\n )\n```\n\nFor both RHEL and Debian families, this recipe pulls the binary\ndistribution from the Oracle website, and installs it in the default\n`JAVA_HOME` for each distribution. For Debian, this is\n`/usr/lib/jvm/default-java`. For RHEl, this is `/usr/lib/jvm/java`.\n\nAfter putting the binaries in place, the `java::oracle` recipe updates\n`/usr/bin/java` to point to the installed JDK using the\n`update-alternatives` script. This is all handled in the `java_ark`\nLWRP.\n\n### oracle_i386\n\nThis recipe installs the 32-bit Java virtual machine without setting\nit as the default. This can be useful if you have applications on the\nsame machine that require different versions of the JVM.\n\nThis recipe operates in a similar manner to `java::oracle`.\n\n### oracle_rpm\n\nThis recipe installs the Oracle JRE or JDK provided by a custom YUM\nrepositories.\nIt also uses the `alternatives` system on RHEL families to set\nthe default Java.\n\n### windows\n\nBecause there is no easy way to pull the java msi off oracle's site,\nthis recipe requires you to host it internally on your own http repo.\n\n**IMPORTANT NOTE**\n\nIf you use the `windows` recipe, you'll need to make sure you've uploaded\nthe `aws` and `windows` cookbooks. As of version 1.18.0, this cookbook\nreferences them with `suggests` instead of `depends`, as they are only\nused by the `windows` recipe.\n\n### ibm\n\nThe `java::ibm` recipe is used to install the IBM version of Java.\nNote that IBM requires you to create an account *and* log in to\ndownload the binary installer for your platform. You must accept the\nlicense agreement with IBM to use their version of Java. In this\ncookbook, you indicate this by setting\n`node['java']['ibm']['accept_ibm_download_terms']` to `true`. You must\nalso host the binary on your own HTTP server to have an automated\ninstallation. The `node['java']['ibm']['url']` attribute must be set\nto a valid https/http URL; the URL is checked for validity in the recipe.\n\nAt this time the `java::ibm` recipe does not support multiple SDK\ninstallations.\n\nResources/Providers\n-----\n\n### java_ark\n\nThis cookbook contains the `java_ark` LWRP. Generally speaking this\nLWRP is deprecated in favor of `ark` from the\n[ark cookbook](https://github.com/opscode-cookbooks/ark), but it is\nstill used in this cookbook for handling the Oracle JDK installation.\n\nBy default, the extracted directory is extracted to\n`app_root/extracted_dir_name` and symlinked to `app_root/default`\n\n#### Actions\n\n- `:install`: extracts the tarball and makes necessary symlinks\n- `:remove`: removes the tarball and run update-alternatives for all\n symlinked `bin_cmds`\n\n#### Attribute Parameters\n\n- `url`: path to tarball, .tar.gz, .bin (oracle-specific), and .zip\n currently supported\n- `checksum`: SHA256 checksum, not used for security but avoid\n redownloading the archive on each chef-client run\n- `app_home`: the default for installations of this type of\n application, for example, `/usr/lib/tomcat/default`. If your\n application is not set to the default, it will be placed at the same\n level in the directory hierarchy but the directory name will be\n `app_root/extracted_directory_name + \"_alt\"`\n- `app_home_mode`: file mode for app_home, is an integer\n- `bin_cmds`: array of binary commands that should be symlinked to\n `/usr/bin`, examples are mvn, java, javac, etc. These cmds must be in\n the `bin` subdirectory of the extracted folder. Will be ignored if this\n `java_ark` is not the default\n- `owner`: owner of extracted directory, set to \"root\" by default\n- `default`: whether this the default installation of this package,\n boolean true or false\n\n#### Examples\n```ruby\n# install jdk6 from Oracle\njava_ark \"jdk\" do\n url 'http://download.oracle.com/otn-pub/java/jdk/6u29-b11/jdk-6u29-linux-x64.bin'\n checksum 'a8603fa62045ce2164b26f7c04859cd548ffe0e33bfc979d9fa73df42e3b3365'\n app_home '/usr/local/java/default'\n bin_cmds [\"java\", \"javac\"]\n action :install\nend\n```\n### java_alternatives\n\nThe `java_alternatives` LWRP uses `update-alternatives` command\nto set and unset command alternatives for various Java tools\nsuch as java, javac, etc.\n\n#### Actions\n\n- `:set`: set alternatives for Java tools\n- `:unset`: unset alternatives for Java tools\n\n#### Attribute Parameters\n\n- `java_location`: Java installation location.\n- `bin_cmds`: array of Java tool names to set or unset alternatives on.\n- `default`: whether to set the Java tools as system default. Boolean, defaults to `true`.\n- `priority`: priority of the alternatives. Integer, defaults to `1061`.\n\n#### Examples\n```ruby\n# set alternatives for java and javac commands\njava_alternatives \"set java alternatives\" do\n java_location '/usr/local/java'\n bin_cmds [\"java\", \"javac\"]\n action :set\nend\n```\n\nProduction Deployment with Oracle Java\n-----\nOracle has been known to change the behavior of its download site frequently. It is recommended you store the archives on an artifact server or s3 bucket. You can then override the attributes in a cookbook, role, or environment:\n\n```ruby\ndefault['java']['jdk_version'] = '7'\ndefault['java']['install_flavor'] = 'oracle'\ndefault['java']['jdk']['7']['x86_64']['url'] = 'http://artifactory.example.com/artifacts/jdk-7u65-linux-x64.tar.gz'\ndefault['java']['oracle']['accept_oracle_download_terms'] = true\n```\n\nRecommendations for inclusion in community cookbooks\n-----\n\nThis cookbook is a dependency for many other cookbooks in the Java/Chef sphere. Here are some guidelines for including it into other cookbooks:\n\n### Allow people to not use this cookbook\nMany users manage Java on their own or have systems that already have java installed. Give these users an option to skip this cookbook, for example:\n```ruby\ninclude_recipe 'java' if node['maven']['install_java']\n```\n\nThis would allow a users of the maven cookbook to choose if they want the maven cookbook to install java for them or leave that up to the consumer.\n\nAnother good example is from the [Jenkins Cookbook Java recipe](https://github.com/opscode-cookbooks/jenkins/commit/ca2a69d982011dc1bec6a6d0ee4da5c1a1599864).\n\n### Pinning to major version of cookbook and Java\nThis cookbook follows semver. It is recommended to pin at the major version of this cookbook when including it in other cookbooks, eg: `depends 'java', '~> 1.0'`\n\nIt is acceptable to set the `node['java']['jdk_version']` to a specific version if required for your software to run, eg software xyz requires Java 8 to run. Refrain from pinning to specific patches of the JDK to allow users to consume security updates.\n\nDevelopment\n-----\n\nThis cookbook uses\n[test-kitchen](https://github.com/opscode/test-kitchen) for\nintegration tests and\n[ChefSpec/RSpec](https://github.com/sethvargo/chefspec) for unit tests.\nSee [TESTING.md](https://github.com/agileorbit-cookbooks/java/blob/master/TESTING.md) for testing instructions.\n\nAt this time due to licensing concerns, the IBM recipe is not set up\nin test kitchen. If you would like to test this locally, copy\n.kitchen.yml to .kitchen.local.yml and add the following suite:\n```yml\nsuites:\n- name: ibm\n run_list: [\"recipe[java]\"]\n attributes:\n java:\n install_flavor: \"ibm\"\n ibm:\n accept_ibm_download_terms: true\n url: \"http://jenkins/ibm-java-x86_64-sdk-7.0-4.1.bin\"\n checksum: the-sha256-checksum\n```\n\nLog into the IBM DeveloperWorks site to download a copy of the IBM\nJava SDK you wish to use/test, host it on an internal HTTP server, and\ncalculate the SHA256 checksum to use in the suite.\n\nLicense and Author\n-----\n\n* Author: Seth Chisamore ()\n* Author: Bryan W. Berry ()\n* Author: Joshua Timberman ()\n* Author: Eric Helgeson ()\n\nCopyright: 2014, Agile Orbit, LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n", 5 | "maintainer": "Agile Orbit", 6 | "maintainer_email": "info@agileorbit.com", 7 | "license": "Apache 2.0", 8 | "platforms": { 9 | "debian": ">= 0.0.0", 10 | "ubuntu": ">= 0.0.0", 11 | "centos": ">= 0.0.0", 12 | "redhat": ">= 0.0.0", 13 | "scientific": ">= 0.0.0", 14 | "fedora": ">= 0.0.0", 15 | "amazon": ">= 0.0.0", 16 | "arch": ">= 0.0.0", 17 | "oracle": ">= 0.0.0", 18 | "freebsd": ">= 0.0.0", 19 | "windows": ">= 0.0.0", 20 | "suse": ">= 0.0.0", 21 | "xenserver": ">= 0.0.0", 22 | "smartos": ">= 0.0.0" 23 | }, 24 | "dependencies": { 25 | }, 26 | "recommendations": { 27 | }, 28 | "suggestions": { 29 | "windows": ">= 0.0.0", 30 | "aws": ">= 0.0.0" 31 | }, 32 | "conflicting": { 33 | }, 34 | "providing": { 35 | }, 36 | "replacing": { 37 | }, 38 | "attributes": { 39 | }, 40 | "groupings": { 41 | }, 42 | "recipes": { 43 | "java::default": "Installs Java runtime", 44 | "java::default_java_symlink": "Updates /usr/lib/jvm/default-java", 45 | "java::ibm": "Installs the JDK for IBM", 46 | "java::ibm_tar": "Installs the JDK for IBM from a tarball", 47 | "java::openjdk": "Installs the OpenJDK flavor of Java", 48 | "java::oracle": "Installs the Oracle flavor of Java", 49 | "java::oracle_i386": "Installs the 32-bit jvm without setting it as the default", 50 | "java::oracle_rpm": "Installs the Oracle RPM flavor of Java", 51 | "java::purge_packages": "Purges old Sun JDK packages", 52 | "java::set_attributes_from_version": "Sets various attributes that depend on jdk_version", 53 | "java::set_java_home": "Sets the JAVA_HOME environment variable", 54 | "java::windows": "Installs the JDK on Windows" 55 | }, 56 | "version": "1.25.0" 57 | } --------------------------------------------------------------------------------