Permalink
Browse files

added capability to install datastax enterprise

  • Loading branch information...
tnosaj committed Jan 24, 2014
1 parent deab6ab commit c5d668e6295e234d3c136058b1147cfdcf0602ea
Showing with 83 additions and 32 deletions.
  1. +3 −1 README.md
  2. +3 −1 attributes/default.rb
  3. +1 −1 metadata.rb
  4. +37 −21 recipes/datastax.rb
  5. +39 −8 recipes/opscenter_server.rb
View
@@ -25,7 +25,7 @@ This cookbook currently provides
Two provided recipes are `cassandra::tarball` and `cassandra::datastax`. The former uses official tarballs
and thus can be used to provision any specific version.
-The latter uses DataStax repository via packages. You can install different versions (ex. dsc20 for v2.0) available in the repository by altering `:package_name` attribute (dsc12 by default).
+The latter uses DataStax repository via packages. You can install different versions (ex. dsc20 for v2.0) available in the repository by altering `:package_name` attribute (dsc12 by default). You can also install the DataStax Enterprise edition by adding `node[:cassandra][:dse]` attributes according to the datastax.rb.
**RHEL only at the moment!**
There are also two recipes for DataStax opscenter installation ( `opscenter_agent` and `opscenter_server` ) along with attributes available for override (see below).
@@ -47,6 +47,8 @@ The optional recipe cassandra::jna will install the jna.jar in the /usr/share/ja
* `node[:cassandra][:rpc_address]` (default: `localhost`): address to bind the RPC interface
* `node[:cassandra][:opscenter][:server][:package_name]` (default: opscenter-free)
+ * `node[:cassandra][:opscenter][:server][:port]` (default: 8888)
+ * `node[:cassandra][:opscenter][:server][:interface]` (default: 0.0.0.0)
* `node[:cassandra][:opscenter][:agent][:download_url]` (default: "") Required. You need to specify
agent download url, because that could be different for each opscenter server version. ( S3 is a great
View
@@ -60,7 +60,9 @@
}
default[:cassandra][:opscenter][:server] = {
- :package_name => "opscenter-free"
+ :package_name => "opscenter-free",
+ :port => "8888",
+ :interface => "0.0.0.0"
}
default[:cassandra][:opscenter][:agent] = {
View
@@ -4,7 +4,7 @@
license "Apache 2.0"
description "Installs/Configures OpsCode Apache Cassandra"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version "2.0.0"
+version "2.0.1"
depends "java"
depends "apt"
View
@@ -46,29 +46,45 @@
case node["platform_family"]
when "debian"
+
+ if node['cassandra']['dse']
+ dse = node['cassandra']['dse']
+ if dse['credentials']['databag']
+ dse_credentials = Chef::EncryptedDataBagItem.load(dse['credentials']['databag']['name'], dse['credentials']['databag']['item'])[dse['credentials']['databag']['entry']]
+ else
+ dse_credentials = dse['credentials']
+ end
+ apt_repository "datastax" do
+ uri "http://#{dse_credentials['username']}:#{dse_credentials['password']}@debian.datastax.com/enterprise"
+ distribution "stable"
+ components ["main"]
+ key "https://debian.datastax.com/debian/repo_key"
+ action :add
+ end
+ else
+ apt_repository "datastax" do
+ uri "https://debian.datastax.com/community"
+ distribution "stable"
+ components ["main"]
+ key "https://debian.datastax.com/debian/repo_key"
+
+ action :add
+ end
- apt_repository "datastax" do
- uri "https://debian.datastax.com/community"
- distribution "stable"
- components ["main"]
- key "https://debian.datastax.com/debian/repo_key"
-
- action :add
- end
-
- # DataStax Server Community Edition package will not install w/o this
- # one installed. MK.
- package "python-cql" do
- action :install
- end
-
- # This is necessary because apt gets very confused by the fact that the
- # latest package available for cassandra is 2.x while you're trying to
- # install dsc12 which requests 1.2.x.
- if node[:platform_family] == "debian" then
- package "cassandra" do
+ # DataStax Server Community Edition package will not install w/o this
+ # one installed. MK.
+ package "python-cql" do
action :install
- version node[:cassandra][:version]
+ end
+
+ # This is necessary because apt gets very confused by the fact that the
+ # latest package available for cassandra is 2.x while you're trying to
+ # install dsc12 which requests 1.2.x.
+ if node[:platform_family] == "debian" then
+ package "cassandra" do
+ action :install
+ version node[:cassandra][:version]
+ end
end
end
@@ -1,6 +1,32 @@
include_recipe "java"
case node["platform_family"]
+when "debian"
+
+ if node['cassandra']['dse']
+ dse = node['cassandra']['dse']
+ if dse['credentials']['databag']
+ dse_credentials = Chef::EncryptedDataBagItem.load(dse['credentials']['databag']['name'], dse['credentials']['databag']['item'])[dse['credentials']['databag']['entry']]
+ else
+ dse_credentials = dse['credentials']
+ end
+ apt_repository "datastax" do
+ uri "http://#{dse_credentials['username']}:#{dse_credentials['password']}@debian.datastax.com/enterprise"
+ distribution "stable"
+ components ["main"]
+ key "https://debian.datastax.com/debian/repo_key"
+ action :add
+ end
+ else
+ apt_repository "datastax" do
+ uri "https://debian.datastax.com/community"
+ distribution "stable"
+ components ["main"]
+ key "https://debian.datastax.com/debian/repo_key"
+ action :add
+ end
+ end
+
when "rhel"
include_recipe "yum"
@@ -10,14 +36,19 @@
url "http://rpm.datastax.com/community"
action :add
end
+end
+package "#{node[:cassandra][:opscenter][:server][:package_name]}" do
+ action :install
+end
- package "#{node[:cassandra][:opscenter][:server][:package_name]}" do
- action :install
- end
-
- service "opscenterd" do
- supports :restart => true, :status => true
- action [:enable, :start]
- end
+service "opscenterd" do
+ supports :restart => true, :status => true
+ action [:enable, :start]
+end
+template "/etc/opscenter/opscenterd.conf" do
+ source "opscenterd.conf.erb"
+ mode 0644
+ notifies :restart, resources(:service => "opscenterd"), :delayed
end
+

0 comments on commit c5d668e

Please sign in to comment.