You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
144 lines
3.6 KiB
144 lines
3.6 KiB
---
|
|
- name: Mettre à jour le cluster de Search Head
|
|
hosts: splunk_deployement
|
|
become: yes
|
|
become_user: root
|
|
vars:
|
|
splunk_version: "9.0.4.1-419ad9369127-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 master cluster Splunk
|
|
hosts: splunk_cluster_master
|
|
become: yes
|
|
become_user: root
|
|
vars:
|
|
splunk_version: "9.0.4.1-419ad9369127-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 un cluster Splunk avec un fichier .tgz
|
|
hosts: splunk_indexer
|
|
become: yes
|
|
become_user: root
|
|
vars:
|
|
splunk_version: "9.0.4.1-419ad9369127-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: Attendre que l'indexer rejoigne le cluster
|
|
#shell: "/opt/splunk/bin/splunk show cluster-state -auth adminsplunk:921223Jocpam!? | grep 'Instance type=peer' | wc -l"
|
|
#register: peers_count
|
|
#until: peers_count.stdout == "2"
|
|
#retries: 5
|
|
#delay: 10
|
|
#become: yes
|
|
|
|
|
|
- name: Mettre à jour le cluster de Search Head
|
|
hosts: splunk_search_head
|
|
become: yes
|
|
become_user: root
|
|
vars:
|
|
splunk_version: "9.0.4.1-419ad9369127-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" |