From e8b934b8dee59f29f0ed98e188df6f7b14127922 Mon Sep 17 00:00:00 2001 From: udhayadevops <155943460+udhayadevops@users.noreply.github.com> Date: Wed, 31 Jan 2024 21:22:58 +0530 Subject: [PATCH 1/4] Update main.yml --- .../roles/elasticsearch/tasks/main.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ansible-elk-playbook/roles/elasticsearch/tasks/main.yml b/ansible-elk-playbook/roles/elasticsearch/tasks/main.yml index 57cb96b..e514450 100644 --- a/ansible-elk-playbook/roles/elasticsearch/tasks/main.yml +++ b/ansible-elk-playbook/roles/elasticsearch/tasks/main.yml @@ -20,13 +20,22 @@ - name: Adding Elasticsearch repo apt_repository: - repo: deb https://artifacts.elastic.co/packages/7.x/apt stable main + repo: deb https://artifacts.elastic.co/packages/8.x/apt stable main state: present - name: Install Elasticsearch apt: name: elasticsearch update_cache: yes + register: installation_output + +- name: Capture specific lines from installation logs + set_fact: + captured_logs: "{{ installation_output.stdout_lines | select('match', 'Authentication and authorization|TLS for the transport and HTTP layers|The generated password for the elastic built-in superuser') | list }}" + +- name: Display captured logs + debug: + var: captured_logs # Update Elasticsearch config file to allow access (to secure Elasticsearch, bind to 'localhost'). From 36c48a45dbbb91c62a6291089717ab23971e8912 Mon Sep 17 00:00:00 2001 From: udhayadevops <155943460+udhayadevops@users.noreply.github.com> Date: Wed, 31 Jan 2024 21:24:30 +0530 Subject: [PATCH 2/4] Update main.yml --- ansible-elk-playbook/main.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ansible-elk-playbook/main.yml b/ansible-elk-playbook/main.yml index 3e9e9a1..7b5d248 100644 --- a/ansible-elk-playbook/main.yml +++ b/ansible-elk-playbook/main.yml @@ -2,7 +2,8 @@ # # Playbook to install the ELK stack + Beats # -- hosts: node +- name: Install ELK + hosts: localhost remote_user: root become: yes become_user: root @@ -11,6 +12,6 @@ - { role: elasticsearch } - { role: logstash } - { role: kibana } - - { role: metricbeat } - - { role: some-data } - - { role: restart-services } + # - { role: metricbeat } + # - { role: some-data } + # - { role: restart-services } From b54aa7329e03ebbdd9df0913b36827cd9084774f Mon Sep 17 00:00:00 2001 From: udhayadevops <155943460+udhayadevops@users.noreply.github.com> Date: Wed, 31 Jan 2024 22:12:29 +0530 Subject: [PATCH 3/4] Update main.yml --- .../roles/elasticsearch/tasks/main.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/ansible-elk-playbook/roles/elasticsearch/tasks/main.yml b/ansible-elk-playbook/roles/elasticsearch/tasks/main.yml index e514450..57cb96b 100644 --- a/ansible-elk-playbook/roles/elasticsearch/tasks/main.yml +++ b/ansible-elk-playbook/roles/elasticsearch/tasks/main.yml @@ -20,22 +20,13 @@ - name: Adding Elasticsearch repo apt_repository: - repo: deb https://artifacts.elastic.co/packages/8.x/apt stable main + repo: deb https://artifacts.elastic.co/packages/7.x/apt stable main state: present - name: Install Elasticsearch apt: name: elasticsearch update_cache: yes - register: installation_output - -- name: Capture specific lines from installation logs - set_fact: - captured_logs: "{{ installation_output.stdout_lines | select('match', 'Authentication and authorization|TLS for the transport and HTTP layers|The generated password for the elastic built-in superuser') | list }}" - -- name: Display captured logs - debug: - var: captured_logs # Update Elasticsearch config file to allow access (to secure Elasticsearch, bind to 'localhost'). From 4fd968d353ec65ab2de0c134b038d6b842cf5836 Mon Sep 17 00:00:00 2001 From: udhayadevops <155943460+udhayadevops@users.noreply.github.com> Date: Wed, 31 Jan 2024 22:12:50 +0530 Subject: [PATCH 4/4] Update main.yml --- ansible-elk-playbook/main.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ansible-elk-playbook/main.yml b/ansible-elk-playbook/main.yml index 7b5d248..3e9e9a1 100644 --- a/ansible-elk-playbook/main.yml +++ b/ansible-elk-playbook/main.yml @@ -2,8 +2,7 @@ # # Playbook to install the ELK stack + Beats # -- name: Install ELK - hosts: localhost +- hosts: node remote_user: root become: yes become_user: root @@ -12,6 +11,6 @@ - { role: elasticsearch } - { role: logstash } - { role: kibana } - # - { role: metricbeat } - # - { role: some-data } - # - { role: restart-services } + - { role: metricbeat } + - { role: some-data } + - { role: restart-services }