Permalink
Browse files

[cm] Updates cluster init to depend on previous requests and start ma…

…nagement services
  • Loading branch information...
1 parent 227dcf4 commit 33d157cac753f4391f93a1eeee0797551c07a5e0 @ashrithr ashrithr committed Mar 20, 2014
Showing with 37 additions and 11 deletions.
  1. +37 −11 cm/manifests/api/cluster.pp
@@ -40,7 +40,8 @@
'get' => "/api/${::cm::api::params::api_version}/cm/service",
'returns' => '404'
},
- log_to => "/var/log/ankus/cm_api/create_mngt_service_${name}"
+ log_to => "/var/log/ankus/cm_api/create_mngt_service_${name}",
+ require => Curl["create-cluster-${name}"]
}
# Enable specified management services
@@ -81,16 +82,17 @@
password => $::cm::params::cm_password,
returns => '200',
only_if => {
- 'get' => "/api/${::cm::api::params::api_version}/cm/service/roles",
+ 'get' => "/api/${::cm::api::params::api_version}/cm/service/roles/ACTIVITYMONITOR1",
'returns' => '404'
},
- log_to => "/var/log/ankus/cm_api/create_mngt_services_${name}"
+ log_to => "/var/log/ankus/cm_api/create_mngt_services_${name}",
+ require => Curl["create-mngt-service-${name}"]
}
# change the base properties for activity monitor
curl { "configure-activity-monitory-${name}":
domain => "http://${::cm::params::cm_server_host}:${::cm::params::cm_api_port}",
- post => "/api/${::cm::api::params::api_version}/cm/service/roleConfigGroups/MGMT-ACTIVITYMONITOR-BASE/config",
+ put => "/api/${::cm::api::params::api_version}/cm/service/roleConfigGroups/MGMT-ACTIVITYMONITOR-BASE/config",
parameters => "{
'items' => [
{
@@ -123,13 +125,14 @@
username => $::cm::params::cm_username,
password => $::cm::params::cm_password,
returns => '200',
- log_to => "/var/log/ankus/cm_api/configure_activity_monitor_${name}"
+ log_to => "/var/log/ankus/cm_api/configure_activity_monitor_${name}",
+ require => Curl["create-mngt-services-${name}"]
}
# change the base properties for service monitor
- curl { "configure-service-monitory-${name}":
+ curl { "configure-service-monitor-${name}":
domain => "http://${::cm::params::cm_server_host}:${::cm::params::cm_api_port}",
- post => "/api/${::cm::api::params::api_version}/cm/service/roleConfigGroups/MGMT-SERVICEMONITOR-BASE/config",
+ put => "/api/${::cm::api::params::api_version}/cm/service/roleConfigGroups/MGMT-SERVICEMONITOR-BASE/config",
parameters => "{
'items' => [
{
@@ -155,20 +158,25 @@
{
'name' => 'firehose_database_password',
'value' => '${::cm::params::cm_smon_database_password}'
- }
+ },
+ {
+ 'name' => 'firehose_debug_port',
+ 'value' => '${::cm::params::cm_smon_debug_port}'
+ },
]
}",
request_type => 'json',
username => $::cm::params::cm_username,
password => $::cm::params::cm_password,
returns => '200',
- log_to => "/var/log/ankus/cm_api/configure_service_monitor_${name}"
+ log_to => "/var/log/ankus/cm_api/configure_service_monitor_${name}",
+ require => Curl["create-mngt-services-${name}"]
}
# change the base properties for host monitor
curl { "configure-host-monitor-${name}":
domain => "http://${::cm::params::cm_server_host}:${::cm::params::cm_api_port}",
- post => "/api/${::cm::api::params::api_version}/cm/service/roleConfigGroups/MGMT-HOSTMONITOR-BASE/config",
+ put => "/api/${::cm::api::params::api_version}/cm/service/roleConfigGroups/MGMT-HOSTMONITOR-BASE/config",
parameters => "{
'items' => [
{
@@ -201,6 +209,24 @@
username => $::cm::params::cm_username,
password => $::cm::params::cm_password,
returns => '200',
- log_to => "/var/log/ankus/cm_api/configure_host_monitor_${name}"
+ log_to => "/var/log/ankus/cm_api/configure_host_monitor_${name}",
+ require => Curl["create-mngt-services-${name}"]
+ }
+
+ # Start management services
+ curl { "start-management-services-${name}":
+ domain => "http://${::cm::params::cm_server_host}:${::cm::params::cm_api_port}",
+ post => "/api/${::cm::api::params::api_version}/cm/service/roleCommands/start",
+ parameters => "{
+ 'items' => [
+ 'ACTIVITYMONITOR1', 'SERVICEMONITOR1', 'HOSTMONITOR1', 'ALERTPUBLISHER1', 'EVENTSERVER1'
+ ]
+ }",
+ request_type => 'json',
+ username => $::cm::params::cm_username,
+ password => $::cm::params::cm_password,
+ returns => '200',
+ log_to => "/var/log/ankus/cm_api/start_management_services_${name}",
+ require => Curl["configure-activity-monitory-${name}", "configure-service-monitor-${name}", "configure-host-monitor-${name}"]
}
}

0 comments on commit 33d157c

Please sign in to comment.