This commit is contained in:
qiaofeng1227 2022-05-17 17:09:10 +08:00
parent a62f11411a
commit 9a284f0378
11 changed files with 78 additions and 0 deletions

0
apps/roles/elk/Notes.md Normal file
View file

View file

@ -0,0 +1 @@

View file

View file

View file

@ -0,0 +1,19 @@
---
dependencies: []
galaxy_info:
author:
description:
company:
license:
min_ansible_version:
platforms:
- name: EL
versions:
- 7
- name: Ubuntu
versions:
- 18.04
galaxy_tags:

View file

View file

View file

@ -0,0 +1,21 @@
- name: wait for {{appname}} start
wait_for:
port: "{{nginx_reverse_proxy_port}}"
delay: 10
timeout: 300
- name: Check {{appname}} Version
shell: |
sudo echo -e "elk_version: `docker exec -it elk-elasticsearch bin/elasticsearch --version | awk -F ' ' '{print $2}'`" |sudo tee -a /data/logs/install_version.txt
- block:
- pause:
prompt: "Please login to Kibana UI and check it, then input Enter to continue"
echo: no
- name: Delete contains and images resources
shell: |
docker-compose down -v
docker system prune --all --force
args:
chdir: /data/wwwroot/elk
when: elk_delete_image == 'y'

View file

@ -0,0 +1,20 @@
- pause:
prompt: |
Do you want to delete containers and images (y/n):
'y': Delete image
'n': Do not delete image
private: no
Default: 'y'
register: delete_image
- set_fact:
elk_delete_image: "{{delete_image.user_input}}"
- debug:
msg: "elk_delete_image is {{elk_delete_image}}"
- name: Config .env for start containers
shell: |
public_ip=`wget -O - https://download.websoft9.com/ansible/get_ip.sh | bash`
sed -i 's/APP_VERSION=.*/APP_VERSION=v{{erpnext_version}}/g' {{installpath}}/{{appname}}/.env
sed -i "s/erp.example.com/$public_ip/g" {{installpath}}/{{appname}}/.env

View file

View file

@ -0,0 +1,17 @@
# global
region: "0"
common_install_docker: True
docker_install: False
nginx_vhost_mode: "reverse"
nginx_reverse_proxy_port: "9001"
nginx_appname: "ELK"
init_application:
elk:
username: elastic
password: "elastic123"
commands:
- sudo sed -i "s/elastic123/$new_password/g" `grep 'elastic123' /data/apps/elk/.env -rnl`
- sudo sed -i "s/elastic123/$new_password/g" `grep 'elastic123' /data/apps/elk/src/logstash/pipeline/logstash.conf -rnl`