Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[cm] Minor updates

  • Loading branch information...
commit 4e83d66aa23e925fd5f2016f94b97adfab9e1db1 1 parent b02247c
Ashrith Mekala ashrithr authored
8 cm/manifests/api/host.pp
View
@@ -11,10 +11,10 @@
post => "/api/${::cm::api::params::api_version}/hosts",
parameters => "{
'items' => [
- 'hostId' => '${name}',
- 'hostname' => '${host_name}',
- 'ipAddress' => '${ip_address}',
- 'rackId' => '${rack_id}'
+ 'hostId' => '${name}',
+ 'hostname' => '${host_name}',
+ 'ipAddress' => '${ip_address}',
+ 'rackId' => '${rack_id}'
]
}",
request_type => 'json',
48 cm/manifests/api/parcels.pp
View
@@ -1,48 +0,0 @@
-define cm::api::parcels($cluster_name = 'test_cluster') {
- require cm::api::params
- notify { $::cm::api::params::cm_domain: }
- # root of the cdh version to use
- $cdh_version = 4
- # get the cdh parcel version to download
- $parcel_version = inline_template("<%=
- require 'rubygems'
- require 'json'
- require 'open-uri'
- JSON.parse(open(\"${cm::api::params::cm_domain}/api/${cm::api::params::api_version}/clusters/${cluster_name}/parcels\", :http_basic_authentication => [\"${cm::params::cm_username}\", \"${cm::params::cm_password}\"]).string)['items'].map do |i|
- i['version'] if(i['product'] == 'CDH' && i['version'] =~ /${cdh_version}/)
- end.compact!
- %>")
-
- curl { "download-parcel-CDH":
- domain => "http://${::cm::params::cm_server_host}:${::cm::params::cm_api_port}",
- post => "/api/${::cm::api::params::api_version}/clusters/${cluster_name}/parcels/products/CDH/versions/${parcel_version}/commands/startDownload",
- parameters => "{
- 'items' => [
- 'hostId' => '${name}',
- 'hostname' => '${host_name}',
- 'ipAddress' => '${ip_address}',
- 'rackId' => '${rack_id}'
- ]
- }",
- request_type => 'json',
- username => $::cm::params::cm_username,
- password => $::cm::params::cm_password,
- returns => '200',
- only_if => {
- 'get' => "/api/${::cm::api::params::api_version}/clusters/${cluster_name}/parcels/products/CDH/versions/${parcel_version}",
- 'returns' => '200',
- 'contains_key' => "stage",
- 'contains_value' => 'AVAILABLE_REMOTELY'
- },
- log_to => "/var/log/ankus/cm_api/parcels_${name}"
- }
-
- # wait until parcel download get's completed
- wait_for { "CDH parcel download completes":
- query => "/usr/bin/curl --silent -X GET -u \"${::cm::params::cm_username}:${::cm::params::cm_password}\" -i -H \"content-type:application/json\" http://${::cm::params::cm_server_host}:${::cm::params::cm_api_port}/api/${::cm::api::params::api_version}/clusters/${cluster_name}/parcels/products/CDH/versions/${parcel_version}",
- regex => '.*stage.*:.*DOWNLOADED.*',
- polling_frequency => 10,
- max_retries => 100,
- subscribe => Curl['download-parcel-CDH']
- }
-}
2  cm/manifests/params.pp
View
@@ -32,6 +32,7 @@
$cm_api_port = hiera('cloduera_manager_api_port', '7180')
$cm_cluster_name = hiera('cm_cluster_name', 'ankus_cluster')
$cm_cluster_ver = hiera('cm_cluster_ver', 'CDH4')
+ $cm_nodes = hiera('cm_cluster_nodes') # ['localhost']
$repo_class = $::osfamily ? {
/(?i-mx:redhat)/ => 'utils::repos::cm::yum',
@@ -94,6 +95,7 @@
$cm_smon_database_name = hiera('cm_smon_database_name', 'smon')
$cm_smon_database_user = hiera('cm_smon_database_user', 'smon')
$cm_smon_listen_port = hiera('cm_smon_listen_port', '9997')
+ $cm_smon_debug_port = hiera('cm_smon_debug_port', '8081')
$cm_smon_database_type = hiera('cm_smon_database_type', 'postgresql')
$cm_smon_database_password = hiera('cm_smon_database_password', 'smon')
$cm_hmon_database_name = hiera('cm_hmon_database_name', 'hmon')
Please sign in to comment.
Something went wrong with that request. Please try again.