|
|
|
@ -6,6 +6,11 @@
|
|
|
|
splunk_version: "9.0.4.1-419ad9369127-Linux-x86_64"
|
|
|
|
splunk_version: "9.0.4.1-419ad9369127-Linux-x86_64"
|
|
|
|
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Sauvegarder la configuration des indexeurs
|
|
|
|
|
|
|
|
command: "{{ splunk_home }}/bin/splunk cmd btool --debug > {{ backup_dir }}/btool_{{ inventory_hostname }}.txt"
|
|
|
|
|
|
|
|
run_once: yes
|
|
|
|
|
|
|
|
|
|
|
|
- name: Arrêter le service Splunk
|
|
|
|
- name: Arrêter le service Splunk
|
|
|
|
systemd:
|
|
|
|
systemd:
|
|
|
|
name: splunk
|
|
|
|
name: splunk
|
|
|
|
@ -16,6 +21,28 @@
|
|
|
|
src: "/tmp/splunk-{{ splunk_version }}.tgz"
|
|
|
|
src: "/tmp/splunk-{{ splunk_version }}.tgz"
|
|
|
|
dest: "/opt"
|
|
|
|
dest: "/opt"
|
|
|
|
remote_src: yes
|
|
|
|
remote_src: yes
|
|
|
|
|
|
|
|
creates: "{{ splunk_home }}/etc/system/local/.upgrade_marker"
|
|
|
|
|
|
|
|
when: inventory_hostname == groups['all:!splunk_uf_Linux:!splunk_uf_windows'][0]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Attribution des droits
|
|
|
|
|
|
|
|
shell: "chown -R splunk:splunk /opt/splunk/*"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Attendre que la mise à jour soit appliquée à tous les indexeurs
|
|
|
|
|
|
|
|
wait_for:
|
|
|
|
|
|
|
|
path: "{{ splunk_home }}/etc/system/local/.upgrade_marker"
|
|
|
|
|
|
|
|
state: present
|
|
|
|
|
|
|
|
when: inventory_hostname != groups['all:!splunk_uf_Linux:!splunk_uf_windows'][0]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Vérifier l'état du cluster
|
|
|
|
|
|
|
|
command: "{{ splunk_home }}/bin/splunk show cluster-status"
|
|
|
|
|
|
|
|
register: cluster_status
|
|
|
|
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
run_once: yes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Afficher l'état du cluster
|
|
|
|
|
|
|
|
debug:
|
|
|
|
|
|
|
|
var: cluster_status.stdout_lines
|
|
|
|
|
|
|
|
run_once: yes
|
|
|
|
|
|
|
|
|
|
|
|
- name: Desactiver le démarrage automatique
|
|
|
|
- name: Desactiver le démarrage automatique
|
|
|
|
shell: "/opt/splunk/bin/splunk disable boot-start"
|
|
|
|
shell: "/opt/splunk/bin/splunk disable boot-start"
|
|
|
|
@ -28,9 +55,6 @@
|
|
|
|
- /etc/init.d/splunk
|
|
|
|
- /etc/init.d/splunk
|
|
|
|
- /etc/systemd/system/splunk.service
|
|
|
|
- /etc/systemd/system/splunk.service
|
|
|
|
|
|
|
|
|
|
|
|
- name: Attribution des droits
|
|
|
|
|
|
|
|
shell: "chown -R splunk:splunk /opt/splunk/*"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Redémarrer le serveur
|
|
|
|
- name: Redémarrer le serveur
|
|
|
|
reboot:
|
|
|
|
reboot:
|
|
|
|
pre_reboot_delay: 0
|
|
|
|
pre_reboot_delay: 0
|
|
|
|
|