-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathambari_configs.txt
More file actions
171 lines (144 loc) · 5.07 KB
/
Copy pathambari_configs.txt
File metadata and controls
171 lines (144 loc) · 5.07 KB
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
> AMBARI_CONFIGS
This module will allow you to read, define and modify configurations for Hadoop (or others) services managed by Ambari
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]
- operation
`get' Retrieve current configuration values for type
`set' Set (or remove) some configuration values for type
`list' Retrieve all existing configuration types, with version
(Choices: set, get, list)[Default: set]
= password
The password associated with the username
[Default: None]
- removed
A list of configuration key which must NOT be present in the configuration
[Default: None]
type: list
- type
Configuration type, such as 'kafka-broker', or 'hdfs-site' .
Required when (operation != 'list')
[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]
- values
A map of of configuration values. See examples below
Required when (operation == 'set')
[Default: None]
AUTHOR: Serge ALEXANDRE
EXAMPLES:
- name: Set kafka-broker configuration
ambari_configs:
ambari_url: "http://sr1.hdp16:8080"
username: admin
password: admin
operation: set
type: kafka-broker
values:
auto.create.topics.enable: "false"
log.retention.hours: 220
no_log: true
# To display current configuration values for a configuration type
- name: Get kafka-broker configuration
ambari_configs:
ambari_url: "http://sr1.hdp16:8080"
username: admin
password: admin
operation: get
type: kafka-broker
no_log: true
register: kafkaBrokerConfig
- debug: var=kafkaBrokerConfig
# To display all available configuration type
- name: Get configuration type list (And current versions)
ambari_configs:
ambari_url: "http://sr1.hdp16:8080"
username: admin
password: admin
operation: list
no_log: true
register: typeList
- debug: var=typeList
# Configuration map can also be a variable
- hosts: sr1
vars:
brokerConfig:
auto.create.topics.enable: "false"
log.retention.hours: 168
tasks:
- name: Set another kafka-broker configuration
ambari_configs:
ambari_url: "http://sr1.hdp16:8080"
username: admin
password: admin
operation: set
type: kafka-broker
values: "{{ brokerConfig }}"
no_log: true
# Or a plain string (Take care of quotes).
- name: Set kafka-broker configuration
ambari_configs:
ambari_url: "http://sr1.hdp16:8080"
username: admin
password: admin
operation: set
type: kafka-broker
values: '{ "log.retention.hours": "220" }'
no_log: true
RETURN VALUES:
types:
description: Return a dict of configuration type as key and version as unique value
returned: When (operation == 'list') and success
type: dict
sample: "types": {
"kafka-broker": {
"version": 4
},
"kafka-env": {
"version": 2
},
"kafka-log4j": {
"version": 2
},
"livy-conf": {
"version": 2
},
....
}
type:
description: Return the provided configuration type, for reference
returned: When ((operation == 'get') or (operantion == 'set)) and success
type: string
sample: kafka-broker
config:
description: Return a dict of configuration value for the provided type
returned: when (operation == 'get') and success
type: dict
sample: "config": {
"auto.create.topics.enable": "false",
"auto.leader.rebalance.enable": "true",
"compression.type": "producer",
"controlled.shutdown.enable": "true",
"controlled.shutdown.max.retries": "3",
"controlled.shutdown.retry.backoff.ms": "5000",
"controller.message.queue.size": "10",
....
}