Skip to content

Commit af8b22a

Browse files
committed
Additional documentation cleanup
- Cleanup additional examples of elasticsearch_plugin - Add more elasticsearch_configure examples / cleanup - Modify default attributes to link instead of horizontal scrolling in README
1 parent 30db3e1 commit af8b22a

File tree

3 files changed

+29
-15
lines changed

3 files changed

+29
-15
lines changed

README.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ the version parameter as a string into your download_url.
2828
|----|-------|------------|
2929
|`default['elasticsearch']['version']`|`'2.0.0'`|[See list](attributes/default.rb).|
3030
|`default['elasticsearch']['install_type']`|`:package`|`:tarball`|
31-
|`default['elasticsearch']['download_urls']['debian']`|`'https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-%s.deb'`|`%s` will be replaced with the version attribute above|
32-
|`default['elasticsearch']['download_urls']['rhel']`|`'https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-%s.noarch.rpm'`|`%s` will be replaced with the version attribute above|
33-
|`default['elasticsearch']['download_urls']['tar']`|`'https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-%s.tar.gz'`|`%s` will be replaced with the version attribute above|
31+
|`default['elasticsearch']['download_urls']['debian']`|[See values](attributes/default.rb).|`%s` will be replaced with the version attribute above|
32+
|`default['elasticsearch']['download_urls']['rhel']`|[See values](attributes/default.rb).|`%s` will be replaced with the version attribute above|
33+
|`default['elasticsearch']['download_urls']['tar']`|[See values](attributes/default.rb).|`%s` will be replaced with the version attribute above|
3434

3535
## Recipes
3636

@@ -86,7 +86,9 @@ elasticsearch_install 'default'
8686
elasticsearch_configure 'default'
8787
elasticsearch_service 'default'
8888

89-
elasticsearch_plugin 'mobz/elasticsearch-head'
89+
elasticsearch_plugin 'head' do
90+
url 'mobz/elasticsearch-head'
91+
end
9092
```
9193

9294
### elasticsearch_user
@@ -120,9 +122,8 @@ Downloads the elasticsearch software, and unpacks it on the system. There are
120122
currently two ways to install -- `:package`, which downloads the appropriate
121123
package from elasticsearch.org and uses the package manager to install it, and
122124
`:tarball` which downloads a tarball from elasticsearch.org and unpacks it in
123-
/usr/local on the system. The resource name is not used for anything in
124-
particular. This resource also comes with a `:remove` action which will remove
125-
the package or directory elasticsearch was unpacked into.
125+
/usr/local on the system. This resource also comes with a `:remove` action
126+
which will remove the package or directory elasticsearch was unpacked into.
126127

127128
You may always specify a download_url and/or download_checksum, and you may
128129
include `%s` which will be replaced by the version parameter you supply.
@@ -177,14 +178,12 @@ elasticsearch_install 'my_es_installation' do
177178
end
178179
```
179180

180-
181-
182181
### elasticsearch_configure
183182
Actions: `:manage`, `:remove`
184183

185184
Configures an elasticsearch instance; creates directories for configuration,
186-
logs, and data. Writes files logging.yml, elasticsearch.in.sh and
187-
elasticsearch.yml.
185+
logs, and data. Writes files `logging.yml`, `elasticsearch.in.sh` and
186+
`elasticsearch.yml`.
188187

189188
The main attribute for this resource is `configuration`,
190189
which is a hash of any elasticsearch configuration directives. The
@@ -205,7 +204,19 @@ With all defaults -
205204
elasticsearch_configure 'elasticsearch'
206205
```
207206

208-
More complicated -
207+
With mostly defaults -
208+
```ruby
209+
elasticsearch_configure 'elasticsearch' do
210+
allocated_memory '512m'
211+
configuration ({
212+
'cluster.name' => 'escluster',
213+
'node.name' => 'node01',
214+
'http.port' => 9201
215+
})
216+
end
217+
```
218+
219+
Very complicated -
209220
```ruby
210221
elasticsearch_configure 'my_elasticsearch' do
211222
# if you override one of these, you probably want to override all
@@ -315,7 +326,8 @@ To run multiple instances per machine, an explicit `plugin_dir` location
315326
has to be provided:
316327

317328
```ruby
318-
elasticsearch_plugin 'mobz/elasticsearch-head' do
329+
elasticsearch_plugin 'head' do
330+
url 'mobz/elasticsearch-head'
319331
plugin_dir '/usr/share/elasticsearch_foo/plugins'
320332
end
321333
```

test/fixtures/cookbooks/elasticsearch_test/recipes/package.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@
3939
instance_name 'special_package_instance'
4040
end
4141

42-
elasticsearch_plugin 'mobz/elasticsearch-head' do
42+
elasticsearch_plugin 'head' do
4343
instance_name 'special_package_instance'
44+
url 'mobz/elasticsearch-head'
4445
end
4546

4647
elasticsearch_service 'elasticsearch-crazy' do

test/fixtures/cookbooks/elasticsearch_test/recipes/tarball.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
instance_name 'special_tarball_instance'
4747
end
4848

49-
elasticsearch_plugin 'mobz/elasticsearch-head' do
49+
elasticsearch_plugin 'head' do
50+
url 'mobz/elasticsearch-head'
5051
instance_name 'special_tarball_instance'
5152
end
5253

0 commit comments

Comments
 (0)