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.
155 lines
3.9 KiB
155 lines
3.9 KiB
---
|
|
- name: Mise à jour de Splunk
|
|
hosts: all:!splunk_uf_Linux
|
|
become: yes
|
|
become_user: root
|
|
|
|
tasks:
|
|
|
|
- name: Copier la sources sur le client
|
|
get_url:
|
|
url: "https://{{ repo_url }}/{{ projet }}/{{ app_name }}"
|
|
dest: /tmp/
|
|
username: "{{ repo_user }}"
|
|
password: "{{ repo_password }}"
|
|
validate_certs: false
|
|
|
|
- name: Suppression jp.py pour upgrade 9.3.X et +
|
|
file:
|
|
state: absent
|
|
path: "/opt/splunk/bin/jp.py"
|
|
|
|
- name: Suppression python2 pour upgrade 9.3.X et +
|
|
file:
|
|
state: absent
|
|
path: "/opt/splunk/bin/python2"
|
|
|
|
- name: Suppression python2.7 pour upgrade 9.3.X et +
|
|
file:
|
|
state: absent
|
|
path: "/opt/splunk/bin/python2.7"
|
|
|
|
- name: Mettre à jour le serveur de deploiement
|
|
hosts: splunk_deployement
|
|
become: yes
|
|
become_user: root
|
|
|
|
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/{{ app_name }}"
|
|
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
|
|
|
|
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/{{ app_name }}"
|
|
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 cluster de Search Head
|
|
hosts: splunk_search_head
|
|
become: yes
|
|
become_user: root
|
|
|
|
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/{{ app_name }}"
|
|
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 d'indexeurs
|
|
hosts: splunk_indexer
|
|
become: yes
|
|
become_user: root
|
|
|
|
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/{{ app_name }}"
|
|
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"
|