Skip to content

Commit

Permalink
[REFACTOR] ลบโค้ดที่ไม่จำเป็น
Browse files Browse the repository at this point in the history
  • Loading branch information
wdrdres3qew5ts21 committed Jun 22, 2020
1 parent 08ab61c commit 48b8fd1
Showing 1 changed file with 1 addition and 74 deletions.
75 changes: 1 addition & 74 deletions Ansible-ELK-Stack/roles/elk_ansible/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@
name: meetu_cert
state: present

# # Generate Self Sign Certificate ถ้าตรงกับเงื่อนไข
# - name: "[SSL] Generate self certificate"
# when: ssl_enabled == "true"
# become: no
# docker_compose:
# project_src: "~/meetu"
# files:
# - create-cert-pem.yml
# state: present

# ต้องใช้ Certificate จาก Let's Encrypt มาเชื่อมกับ container ของเราผ่าน volume
- name: "Start Elasticsearch Docker"
vars:
Expand Down Expand Up @@ -78,19 +68,6 @@
xpack.security.transport.ssl.certificate: "{{cert_dir}}/cert.pem"
xpack.security.transport.ssl.certificate_authorities: "{{cert_dir}}/fullchain.pem"

# - name: Create Kibana Config Directory
# become: no
# file:
# path: ~/kibana
# state: directory

# - name: Config Kibana Template.yml
# become: no
# template:
# src: kibana.yml
# dest: ~/kibana/kibana.yml
# force: yes

- name: "Start Kibana Docker"
become: no
vars:
Expand Down Expand Up @@ -119,38 +96,6 @@
ELASTICSEARCH_SSL_VERIFICATIONMODE: "none"
volumes:
- "/home/{{ansible_user}}/ssl-certificate:{{cert_dir}}"
# - "~/kibana/kibana.yml:/usr/share/kibana/config/kibana.yml"
# when: ssl_enabled == "true"

# - name: "Start Kibana Docker"
# become: no
# vars:
# # ตำแหน่งของ cert_dir ที่อยู่ใน "container" แล้ว ว่าไฟล์อยู่ในที่ไหนของ "container"
# - cert_dir: "/usr/share/elasticsearch/config/certificates"
# docker_container:
# image: docker.elastic.co/kibana/kibana:7.7.0
# name: kibana
# restart: yes
# state: started
# networks_cli_compatible: yes
# networks:
# - name: meetu_elastic
# published_ports:
# - "5601:5601"
# env:
# SERVER_HOST: "0.0.0.0"
# ELASTICSEARCH_HOSTS: "http://elasticsearch1:9200"
# ELASTICSEARCH_USERNAME: "kibana"
# ELASTICSEARCH_PASSWORD: "{{elastic_password}}"
# SERVER_SSL_ENABLED: "{{ ssl_enabled | default('false') }}"
# SERVER_SSL_KEY: "{{cert_dir}}/privkey.pem"
# SERVER_SSL_CERTIFICATE: "{{cert_dir}}/cert.pem"
# ELASTICSEARCH_SSL_CERTIFICATEAUTHORITIES: "{{cert_dir}}/fullchain.pem"
# ELASTICSEARCH_SSL_VERIFICATIONMODE: "certificate"
# volumes:
# - "/home/{{ansible_user}}/ssl-certificate:{{cert_dir}}"
# - "~/kibana/kibana.yml:/usr/share/kibana/config/kibana.yml"
# when: ssl_enabled == "false"

- name: "[{{ (ssl_enabled == 'true') | ternary('https','http') }}] Change Kibana Password API"
uri:
Expand All @@ -167,22 +112,4 @@
register: _result
until: _result.status == 200
retries: 20
delay: 5
# - name: "[HTTP] Change Kibana Password API"
# uri:
# url: "http://localhost:9200/_security/user/kibana/_password?pretty"
# follow_redirects: none
# method: POST
# user: elastic
# password: "{{elastic_password}}"
# validate_certs: no
# force_basic_auth: yes
# body_format: json
# body: >
# { "password": "{{elastic_password}}" }
# register: _result
# until: _result.status == 200
# retries: 20
# delay: 5
# when: ssl_enabled == "false"

delay: 5

0 comments on commit 48b8fd1

Please sign in to comment.