From d7ed03e6221de48c685235a3df970c8beaa99ce0 Mon Sep 17 00:00:00 2001 From: admingit Date: Mon, 20 Nov 2023 14:25:20 +0100 Subject: [PATCH] updatemaj --- Update_SplunkV2.yml | 46 ++++++++++++++++++++++++++++++++++++------ Update_Splunk_UFV2.yml | 9 ++++++++- 2 files changed, 48 insertions(+), 7 deletions(-) diff --git a/Update_SplunkV2.yml b/Update_SplunkV2.yml index 282ac0f..4960fca 100644 --- a/Update_SplunkV2.yml +++ b/Update_SplunkV2.yml @@ -1,17 +1,17 @@ --- -- hosts: all_splunk_instances:splunk_hf_Linux:!splunk_uf_Linux:!splunk_uf_Windows +- hosts: all_splunk_instances:splunk_uf_Linux:!splunk_uf_Windows tasks: - name: Copie sources become: yes become_user: root - shell: scp admin@10.10.40.21:/tmp/splunk-9.1.0.2-b6436b649711-Linux-x86_64.tgz /tmp/ + shell: scp admin@10.10.40.21:/tmp/splunk-9.1.2-b6b9c8185839-Linux-x86_64.tgz /tmp/ - name: Mettre à jour le cluster de Search Head hosts: splunk_deployement become: yes become_user: root vars: - splunk_version: "9.1.0.2-b6436b649711-Linux-x86_64" + splunk_version: "9.1.2-b6b9c8185839-Linux-x86_64" tasks: @@ -45,7 +45,7 @@ become: yes become_user: root vars: - splunk_version: "9.1.0.2-b6436b649711-Linux-x86_64" + splunk_version: "9.1.2-b6b9c8185839-Linux-x86_64" tasks: @@ -79,7 +79,7 @@ become: yes become_user: root vars: - splunk_version: "9.1.0.2-b6436b649711-Linux-x86_64" + splunk_version: "9.1.2-b6b9c8185839-Linux-x86_64" tasks: - name: Arrêter les processus Splunk @@ -121,7 +121,41 @@ become: yes become_user: root vars: - splunk_version: "9.1.0.2-b6436b649711-Linux-x86_64" + splunk_version: "9.1.2-b6b9c8185839-Linux-x86_64" + + + tasks: + - name: Arrêter les processus Splunk + shell: "/opt/splunk/bin/splunk stop" + become: yes + + - name: Extraire le fichier d'installation de Splunk + unarchive: + src: "/tmp/splunk-{{ splunk_version }}.tgz" + dest: "/opt" + remote_src: yes + + - name: Attribution des droits + shell: "chown -R splunk:splunk /opt/splunk/*" + + - name: Mettre à jour Splunk + shell: "/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt" + + - name: Vérifier l'état de Splunk + wait_for: + host: localhost + port: 8089 + delay: 10 + timeout: 180 + state: started + msg: "Splunk n'a pas redémarré correctement" + +- name: Mettre à jour le HeavyForwarder + hosts: splunk_hf_Linux + become: yes + become_user: root + vars: + splunk_version: "9.1.2-b6b9c8185839-Linux-x86_64" tasks: diff --git a/Update_Splunk_UFV2.yml b/Update_Splunk_UFV2.yml index 5b95216..4643c92 100644 --- a/Update_Splunk_UFV2.yml +++ b/Update_Splunk_UFV2.yml @@ -1,9 +1,16 @@ +- hosts: splunk_uf_Linux + tasks: + - name: Copie sources + become: yes + become_user: root + shell: scp admin@10.10.40.21:/tmp/splunkforwarder-9.1.1-64e843ea36b1-Linux-x86_64.tgz /tmp/ + - name: Mise à jour de Splunk hosts: splunk_uf_Linux become: yes become_user: "{{ privileged_user }}" vars: - splunk_version_uf: "9.0.4-de405f4a7979-Linux-x86_64" + splunk_version_uf: "9.1.1-64e843ea36b1-Linux-x86_64" tasks: