Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Ijaz Ahmad
ansible-elk-playbook
Commits
2dc809a7
Commit
2dc809a7
authored
Jul 24, 2017
by
Daniel Berman
Committed by
GitHub
Jul 24, 2017
Browse files
Update main.yml
parent
e57f6cca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
26 deletions
+40
-26
roles/elasticsearch/tasks/main.yml
roles/elasticsearch/tasks/main.yml
+40
-26
No files found.
roles/elasticsearch/tasks/main.yml
View file @
2dc809a7
...
...
@@ -2,31 +2,45 @@
#
# Installing Elasticsearch
#
# Install Elasticsearch
-
name
:
Install Elasticsearch
-
shell
:
sudo wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
-
shell
:
sudo apt-get install apt-transport-https
-
shell
:
sudo echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-5.x.list
-
shell
:
sudo apt-get update && sudo apt-get install elasticsearch
# Configurations
-
name
:
Updating the config file to allow remote access
# Add Elasticsearch apt key
-
name
:
Add Elasticsearch apt-key
apt_key
:
url
:
"
https://packages.elastic.co/GPG-KEY-elasticsearch"
state
:
present
# Add the Elasticsearch apt repo
-
name
:
Adding Elasticsearch repo
apt_repository
:
repo
:
deb https://artifacts.elastic.co/packages/5.x/apt stable main
state
:
present
# Installing Elasticsearch
-
name
:
Update repositories cache and install Elasticsearch
apt
:
name
:
elasticsearch
update_cache
:
yes
# Update Elasticsearch config file to allow access. To secure Elasticsearch, bind to 'localhost'.
-
name
:
Updating the config file to allow outside access
lineinfile
:
destfile
:
/etc/elasticsearch/elasticsearch.yml
regexp
:
'
network.host:'
line
:
'
network.host:
0.0.0.0'
-
name
:
Updating the config file to define port
destfile
:
/etc/elasticsearch/elasticsearch.yml
regexp
:
'
network.host:'
line
:
'
network.host:
0.0.0.0'
# Update Elasticsearch port in config file
-
name
:
Updating the port in config file
lineinfile
:
destfile
:
/etc/elasticsearch/elasticsearch.yml
regexp
:
'
http.port:'
line
:
'
http.port:
9200'
# Starting Elasticsearch
-
name
:
Enabling Elasticsearch service
systemd
:
name
:
elasticsearch
enabled
:
yes
daemon_reload
:
yes
# Start Elasticsearch service
-
name
:
Starting Elasticsearch service
systemd
:
name
:
elasticsearch
state
:
started
destfile
:
/etc/elasticsearch/elasticsearch.yml
regexp
:
'
http.port:'
line
:
'
http.port:
9200'
# Start Elasticsearch
-
name
:
Starting Elasticsearch
service
:
name
:
elasticsearch
state
:
started
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment