diff --git a/playbook/roles/elasticsearch/tasks/main.yml b/playbook/roles/elasticsearch/tasks/main.yml index 8257c3af6341fffa7d17778b7e95734fa2569ba2..55584e5a9b73bcd899b4eff781f17a18b2a82ae1 100644 --- a/playbook/roles/elasticsearch/tasks/main.yml +++ b/playbook/roles/elasticsearch/tasks/main.yml @@ -5,25 +5,27 @@ state: present - name: mkdir elasticsearch shell: mkdir -p /opt/elasticsearch -- name: get elasticsearch from official website - shell: wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.17.16-linux-x86_64.tar.gz --no-check-certificate - args: - chdir: /root/ +- name: installl elasticsearch for x86_64 system + block: + - name: get elasticsearch from official website + shell: wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.17.16-linux-x86_64.tar.gz --no-check-certificate + args: + chdir: /root/ + - name: unzip tar.gz + shell: tar -xzvf elasticsearch-7.17.16-linux-x86_64.tar.gz -C /opt/elasticsearch --strip-components 1 + args: + chdir: /root/ when: ansible_architecture == "x86_64" -- name: unzip tar.gz - shell: tar -xzvf elasticsearch-7.17.16-linux-x86_64.tar.gz -C /opt/elasticsearch --strip-components 1 - args: - chdir: /root/ - when: ansible_architecture == "x86_64" -- name: get elasticsearch from official website - shell: wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.17.16-linux-aarch64.tar.gz --no-check-certificate - args: - chdir: /root/ - when: ansible_architecture == "aarch64" -- name: unzip tar.gz - shell: tar -xzvf elasticsearch-7.17.16-linux-aarch64.tar.gz -C /opt/elasticsearch --strip-components 1 - args: - chdir: /root/ +- name: install elasticsearch for aarch64 system + block: + - name: get elasticsearch from official website + shell: wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.17.16-linux-aarch64.tar.gz --no-check-certificate + args: + chdir: /root/ + - name: unzip tar.gz + shell: tar -xzvf elasticsearch-7.17.16-linux-aarch64.tar.gz -C /opt/elasticsearch --strip-components 1 + args: + chdir: /root/ when: ansible_architecture == "aarch64" - name: add elastic user shell: groupadd elastic && useradd elastic -g elastic diff --git a/playbook/roles/filebeat/tasks/main.yml b/playbook/roles/filebeat/tasks/main.yml index 3c4820ad77748ff40eba09131fa1298219a6436b..f4f333c4b59c71592632023b60f6ee0783521796 100644 --- a/playbook/roles/filebeat/tasks/main.yml +++ b/playbook/roles/filebeat/tasks/main.yml @@ -1,25 +1,27 @@ --- - name: mkdir filebeat shell: mkdir -p /opt/filebeat -- name: get fliebeat from official website - shell: wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.17.16-linux-x86_64.tar.gz --no-check-certificate - args: - chdir: /root/ +- name: install fliebeat for x86_64 system + block: + - name: get fliebeat from official website + shell: wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.17.16-linux-x86_64.tar.gz --no-check-certificate + args: + chdir: /root/ + - name: unzip tar.gz + shell: tar -xzvf filebeat-7.17.16-linux-x86_64.tar.gz -C /opt/filebeat --strip-components 1 + args: + chdir: /root/ when: ansible_architecture == "x86_64" -- name: unzip tar.gz - shell: tar -xzvf filebeat-7.17.16-linux-x86_64.tar.gz -C /opt/filebeat --strip-components 1 - args: - chdir: /root/ - when: ansible_architecture == x86_64 -- name: get filebeat from official website - shell: wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.17.16-linux-arm64.tar.gz --no-check-certificate - args: - chdir: /root/ - when: ansible_architecture == "aarch64" -- name: unzip tar.gz - shell: tar -xzvf filebeat-7.17.16-linux-arm64.tar.gz -C /opt/filebeat --strip-components 1 - args: - chdir: /root/ +- name: install fliebeat for aarch64 system + block: + - name: get filebeat from official website + shell: wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.17.16-linux-arm64.tar.gz --no-check-certificate + args: + chdir: /root/ + - name: unzip tar.gz + shell: tar -xzvf filebeat-7.17.16-linux-arm64.tar.gz -C /opt/filebeat --strip-components 1 + args: + chdir: /root/ when: ansible_architecture == "aarch64" - name: start filebeat shell: nobup /opt/filebeat/filebeat -c /opt/filebeat/filebeat.yml & \ No newline at end of file diff --git a/playbook/roles/kibana/tasks/main.yml b/playbook/roles/kibana/tasks/main.yml index dbebd5867e0b1ba3b97dbc8a6bdc4e658ebeed55..a7985a59ddf2e95be012609ebdf0bb952c088e91 100644 --- a/playbook/roles/kibana/tasks/main.yml +++ b/playbook/roles/kibana/tasks/main.yml @@ -1,25 +1,27 @@ --- - name: mkdir kibana shell: mkdir -p /opt/kibana -- name: get kibana from official website - shell: wget https://artifacts.elastic.co/downloads/kibana/kibana-7.17.16-linux-x86_64.tar.gz --no-check-certificate - args: - chdir: /root/ +- name: install kibana for x86_64 system + block: + - name: get kibana from official website + shell: wget https://artifacts.elastic.co/downloads/kibana/kibana-7.17.16-linux-x86_64.tar.gz --no-check-certificate + args: + chdir: /root/ + - name: unzip tar.gz + shell: tar -xzvf kibana-7.17.16-linux-x86_64.tar.gz -C /opt/kibana --strip-components 1 + args: + chdir: /root/ when: ansible_architecture == "x86_64" -- name: unzip tar.gz - shell: tar -xzvf kibana-7.17.16-linux-x86_64.tar.gz -C /opt/kibana --strip-components 1 - args: - chdir: /root/ - when: ansible_architecture == "x86_64" -- name: get kibana from official website - shell: wget https://artifacts.elastic.co/downloads/kibana/kibana-7.17.16-linux-aarch64.tar.gz --no-check-certificate - args: - chdir: /root/ - when: ansible_architecture == "aarch64" -- name: unzip tar.gz - shell: tar -xzvf kibana-7.17.16-linux-aarch64.tar.gz -C /opt/kibana --strip-components 1 - args: - chdir: /root/ +- name: install kibana for aarch64 system + block: + - name: get kibana from official website + shell: wget https://artifacts.elastic.co/downloads/kibana/kibana-7.17.16-linux-aarch64.tar.gz --no-check-certificate + args: + chdir: /root/ + - name: unzip tar.gz + shell: tar -xzvf kibana-7.17.16-linux-aarch64.tar.gz -C /opt/kibana --strip-components 1 + args: + chdir: /root/ when: ansible_architecture == "aarch64" - name: change es config template: src=templates/kibana/kibana.yml.j2 dest=/opt/kibana/config/kibana.yml