Commit 0fed1cf1 authored by Joshua Timberman's avatar Joshua Timberman
Browse files

Merge pull request #29 from opscode-cookbooks/jtimberman/cleanup-and-fixes

Some various cleanup and fixes for this cookbook
parents 64dd6257 e5679500
......@@ -12,3 +12,4 @@ Gemfile.lock
.kitchen
bin
.kitchen.local.yml
.kitchen/
---
driver_plugin: vagrant
driver_plugin: digitalocean
driver_config:
digitalocean_client_id: <%= ENV['DIGITAL_OCEAN_CLIENT_ID'] %>
digitalocean_api_key: <%= ENV['DIGITAL_OCEAN_API_KEY'] %>
aws_access_key_id: <%= ENV['AWS_ACCESS_KEY_ID'] %>
aws_secret_access_key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %>
aws_ssh_key_id: <%= ENV['AWS_KEYPAIR_NAME'] %>
ssh_key: <%= ENV['AWS_PRIVATE_KEY_PATH'] %>
rackspace_username: <%= ENV['RACKSPACE_USERNAME'] %>
rackspace_api_key: <%= ENV['RACKSPACE_API_KEY'] %>
require_chef_omnibus: latest
platforms:
- name: centos-5.8
driver_plugin: digitalocean
driver_config:
image_id: 1601
flavor_id: 63
region_id: 1
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
- name: centos-6.4
driver_plugin: digitalocean
driver_config:
image_id: 562354
flavor_id: 63
region_id: 1
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
- name: amazon-2013.09
driver_plugin: ec2
driver_config:
image_id: ami-3be4bc52
username: ec2-user
- name: ubuntu-10.04
driver_plugin: digitalocean
driver_config:
image_id: 14097
flavor_id: 63
region_id: 1
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
run_list:
- recipe[apt::default]
- name: ubuntu-12.04
driver_plugin: digitalocean
driver_config:
image_id: 1505447
flavor_id: 63
region_id: 1
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
run_list:
- recipe[apt::default]
---
driver_plugin: vagrant
driver_plugin: digitalocean
driver_config:
digitalocean_client_id: <%= ENV['DIGITAL_OCEAN_CLIENT_ID'] %>
digitalocean_api_key: <%= ENV['DIGITAL_OCEAN_API_KEY'] %>
aws_access_key_id: <%= ENV['AWS_ACCESS_KEY_ID'] %>
aws_secret_access_key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %>
aws_ssh_key_id: <%= ENV['AWS_KEYPAIR_NAME'] %>
ssh_key: <%= ENV['AWS_PRIVATE_KEY_PATH'] %>
rackspace_username: <%= ENV['RACKSPACE_USERNAME'] %>
rackspace_api_key: <%= ENV['RACKSPACE_API_KEY'] %>
require_chef_omnibus: latest
driver:
name: vagrant
platforms:
- name: centos-5.8
driver_plugin: digitalocean
driver_config:
image_id: 1601
flavor_id: 63
region_id: 1
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
- name: centos-6.4
driver_plugin: digitalocean
driver_config:
image_id: 562354
flavor_id: 63
region_id: 1
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
- name: amazon-2013.09
driver_plugin: ec2
driver_config:
image_id: ami-3be4bc52
username: ec2-user
provisioner:
name: chef_zero
platforms:
- name: centos-5.11
- name: centos-6.6
- name: ubuntu-10.04
driver_plugin: digitalocean
driver_config:
image_id: 14097
flavor_id: 63
region_id: 1
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
run_list:
- recipe[apt::default]
run_list:
- recipe[apt]
- name: ubuntu-12.04
driver_plugin: digitalocean
driver_config:
image_id: 1505447
flavor_id: 63
region_id: 1
ssh_key_ids: <%= ENV['DIGITAL_OCEAN_SSH_KEY_IDS'] %>
run_list:
- recipe[apt::default]
run_list:
- recipe[apt]
- name: ubuntu-14.04
run_list:
- recipe[apt]
suites:
- name: default
run_list:
- 'recipe[erlang]'
attributes: {}
- recipe[erlang]
- name: gui_tools
run_list:
- 'recipe[erlang]'
attributes: { erlang: { gui_tools: true } }
excludes: ['centos-5.8', 'centos-6.4', 'amazon-2013.09']
- recipe[erlang]
attributes:
erlang:
gui_tools: true
excludes:
- centos-5.11
- centos-6.6
- name: esl
run_list:
- 'recipe[erlang::esl]'
attributes: {}
excludes: ['centos-5.8']
- recipe[erlang::esl]
excludes:
- centos-5.11
- name: source
run_list:
- 'recipe[erlang::source]'
attributes: {}
- recipe[erlang::source]
AllCops:
Include:
- Berksfile
- Gemfile
- Rakefile
- Thorfile
- Guardfile
Exclude:
- vendor/**
Encoding:
Enabled: false
......@@ -6,3 +16,12 @@ LineLength:
HashSyntax:
EnforcedStyle: hash_rockets
Style/SingleSpaceBeforeFirstArg:
Exclude:
- Rakefile
- metadata.rb
Style/PercentLiteralDelimiters:
Exclude:
- metadata.rb
site 'https://supermarket.chef.io'
source 'https://supermarket.chef.io'
metadata
......
......@@ -14,11 +14,10 @@ Chef version 0.10.10+ and Ohai 0.6.12+ are required
Tested on:
* Ubuntu 10.04, 11.10, 12.04
* Red Hat Enterprise Linux (CentOS/Amazon/Scientific/Oracle) 5.7, 6.2
* Ubuntu 10.04, 11.10, 12.04, 14.04
* Red Hat Enterprise Linux (CentOS/Amazon/Scientific/Oracle) 5.11, 6.6
**Notes**: This cookbook has been tested on the listed platforms. It
may work on other platforms with or without modification.
**Notes**: This cookbook has been tested on the listed platforms. It may work on other platforms with or without modification.
## Cookbooks
......@@ -63,8 +62,7 @@ Installs Erlang from source.
## erlang_solutions
Adds Erlang Solutions' [package repositories][] on Debian, CentOS (>
5), and Fedora systems, and installs the `esl-erlang` package.
Adds Erlang Solutions' [package repositories][] on Debian, CentOS (>5), and Fedora systems, and installs the `esl-erlang` package.
[package repositories]:https://www.erlang-solutions.com/downloads/download-erlang-otp
......
......@@ -20,4 +20,4 @@
# limitations under the License.
#
include_recipe "erlang::#{node["erlang"]["install_method"]}"
include_recipe "erlang::#{node['erlang']['install_method']}"
......@@ -17,7 +17,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Install Erlang/OTP from Erlang Solutions
case node['platform_family']
......@@ -40,12 +39,12 @@ when 'debian'
when 'rhel'
if node['platform_version'].to_i <= 5
Chef::Log.fatal('Erlang Solutions pacakge repositories are not available for EL5')
else
# include_recipe 'yum-repoforge'
include_recipe 'yum-erlang_solutions'
fail
end
package 'erlang' do
include_recipe 'yum-erlang_solutions'
package 'esl-erlang' do
version node['erlang']['esl']['version'] if node['erlang']['esl']['version']
end
......@@ -54,7 +53,7 @@ end
# There's a small bug in the package for Ubuntu 10.04... this fixes
# it. Solution found at
# https://github.com/davidcoallier/bigcouch/blob/f6a6daf7590ecbab4d9dc4747624573b3137dfad/README.md#ubuntu-1004-lts-potential-issues
if platform?('ubuntu') && node['platform_version'] == '10.04'
if platform?('ubuntu') && node['platform_version'] == '10.04' # ~FC023
bash 'ubuntu-10.04-LTS-erlang-fix' do
user 'root'
cwd '/usr/lib/erlang/man/man5'
......
......@@ -28,18 +28,21 @@ when 'debian'
package 'erlang-dev'
when 'rhel'
include_recipe 'yum-epel'
case node['platform_version'].to_i
when 5
if node['platform_version'].to_i == 5
Chef::Log.warn('Adding EPEL Erlang Repo. This will have SSL verification disabled, as')
Chef::Log.warn('RHEL/CentOS 5.x will not be able to verify the SSL certificate of this')
Chef::Log.warn('repository despite it being valid because yum on does not correctly')
Chef::Log.warn('follow the HTTP redirect.')
yum_repository 'EPELErlangrepo' do
description "Updated erlang yum repository for RedHat / Centos 5.x - #{node['kernel']['machine']}"
baseurl 'http://repos.fedorapeople.org/repos/peter/erlang/epel-5Server/$basearch'
gpgcheck false
sslverify false
action :create
end
else
include_recipe 'yum-erlang_solutions'
end
include_recipe 'yum-epel'
package 'erlang'
end
......@@ -24,9 +24,9 @@ include_recipe 'build-essential'
erlang_deps = case node['platform_family']
when 'debian'
%w{ libncurses5-dev openssl libssl-dev }
%w(libncurses5-dev openssl libssl-dev)
when 'rhel', 'fedora'
%w{ ncurses-devel openssl-devel }
%w(ncurses-devel openssl-devel)
else
[]
end
......@@ -43,7 +43,7 @@ bash 'install-erlang' do
tar -xzf otp_src_#{node['erlang']['source']['version']}.tar.gz
(cd otp_src_#{node['erlang']['source']['version']} && ./configure #{node['erlang']['source']['build_flags']} && make && make install)
EOH
environment({"CFLAGS" => node['erlang']['source']['cflags']})
environment('CFLAGS' => node['erlang']['source']['cflags'])
action :nothing
not_if "erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell | grep #{node['erlang']['source']['version']}"
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment