-
Notifications
You must be signed in to change notification settings - Fork 0
/
ambari_host_services.txt
119 lines (97 loc) · 3.3 KB
/
ambari_host_services.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
> AMBARI_HOST_SERVICE
This module will allow you to stop/start all services on a specific host. Typical use case is host rolling restart
OPTIONS (= is mandatory):
- ambari_server
This parameters allow grouping of all Ambari server access related parameters in one dict, this to embed all theses
parameters in one variable.
Keys of this dict can be `ambari_url', `username', `password', `validate_certs', `ca_bundle_file'
[Default: None]
= ambari_url
The Ambari base URL to access Ambari API. Same host:port as the Ambari Admin GUI. Typically
http://myambari.server.com:8080 or https://myambari.server.com:xxxx
[Default: None]
- ca_bundle_file
Useful if Ambari connection is using SSL. Allow to specify a CA_BUNDLE file, a file that contains root and intermediate
certificates to validate the Ambari certificate.
In its simplest case, it could be a file containing the server certificate in .pem format.
This file will be looked up on the remote system, on which this module will be executed.
[Default: None]
= host
The host we start/stop service on. Must be as expressed in Ambari
[Default: None]
= password
The password associated with the username
[Default: None]
= state
Target state for all services on this host
(Choices: stopped, started)[Default: None]
= username
The user name to log on Ambari.
[Default: None]
- validate_certs
Useful if Ambari connection is using SSL. If no, SSL certificates will not be validated. This should only be used on
personally controlled sites using self-signed certificates.
[Default: True]
AUTHOR: Serge ALEXANDRE
EXAMPLES:
# Stop all services on host dn1
- hosts: sr1
vars:
ambariServer:
ambari_url: "http://sr1.my.cluster.com:8080"
username: admin
password: admin
roles:
- ambari_modules
tasks:
- name: "Stop services on dn1"
ambari_host_services:
ambari_server: "{{ambariServer}}"
host: "dn1.my.cluster.com"
state: "stopped"
# Start all services on host dn1.
# Note we setup a retry mechanism, as this task will fail if the host is temporary unsynchronized with Ambari (Heartbeat lost).
# This will typically occurs after a host reboot.
- hosts: sr1
vars:
ambariServer:
ambari_url: "http://sr1.my.cluster.com:8080"
username: admin
password: admin
roles:
- ambari_modules
tasks:
- name: "Start services on dn1"
ambari_host_services:
ambari_server: "{{ambariServer}}"
host: "dn1.my.cluster.com"
state: "started"
register: startService
retries: 30
delay: 10
until: not startService.failed
RETURN VALUES:
stopped:
description: A list of services which was stopped.
type: list of string
sample:
"stopped": [
"DATANODE",
"HBASE_REGIONSERVER",
"KAFKA_BROKER",
"METRICS_MONITOR",
"NODEMANAGER",
"SUPERVISOR"
]
started:
description: A list of services which was started.
type: list of string
sample:
"started": [
"DATANODE",
"HBASE_REGIONSERVER",
"KAFKA_BROKER",
"METRICS_MONITOR",
"NODEMANAGER",
"SUPERVISOR"
]