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.
68 lines
1.9 KiB
68 lines
1.9 KiB
- name: Mise à jour de Splunk
|
|
hosts: all:!splunk_uf_Linux:!splunk_uf_windows
|
|
become: yes
|
|
become_user: root
|
|
vars:
|
|
splunk_version: "9.0.4.1-419ad9369127-Linux-x86_64"
|
|
|
|
tasks:
|
|
#- name: Arrêter le service Splunk
|
|
#systemd:
|
|
#name: splunk
|
|
#state: stopped
|
|
|
|
#- name: Extraire le fichier d'installation de Splunk
|
|
#unarchive:
|
|
#src: "/tmp/splunk-{{ splunk_version }}.tgz"
|
|
#dest: "/opt"
|
|
#remote_src: yes
|
|
|
|
#- name: Desactiver le démarrage automatique
|
|
#shell: "/opt/splunk/bin/splunk disable boot-start"
|
|
|
|
#- name: Supprimer les entrées de démarrage automatique de Splunk
|
|
#file:
|
|
#path: "{{ item }}"
|
|
#state: absent
|
|
#with_items:
|
|
#- /etc/init.d/splunk
|
|
#- /etc/systemd/system/splunk.service
|
|
|
|
#- name: Attribution des droits
|
|
#shell: "chown -R splunk:splunk /opt/splunk/*"
|
|
|
|
- name: Démarrer Splunk
|
|
shell: "/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt"
|
|
|
|
- name: Boot-start Enable
|
|
shell: "/opt/splunk/bin/splunk enable boot-start"
|
|
|
|
- name: Attente de la disponibilité de Splunk
|
|
uri:
|
|
url: "http://localhost:8000/"
|
|
return_content: no
|
|
status_code: 200
|
|
register: result
|
|
retries: 30
|
|
delay: 10
|
|
until: result.status == 200
|
|
|
|
- name: Appliquer les changements de configuration
|
|
shell: "/opt/splunk/bin/splunk apply cluster-bundle --answer-yes --no-prompt"
|
|
|
|
- name: Redémarrer le service Splunk
|
|
systemd:
|
|
name: splunk
|
|
state: started
|
|
|
|
|
|
#- name: Sauvegarder la configuration et les données
|
|
#shell: /opt/splunk/bin/splunk cmd splunkd print-paths --propagation none
|
|
#register: splunk_paths
|
|
|
|
#- name: Installer la nouvelle version de Splunk
|
|
#unarchive:
|
|
#src: /tmp/splunk-{{ splunk_version }}.tgz
|
|
#dest: /opt
|
|
#creates: /opt/splunk-{{ splunk_version }}
|