--- - name: Supprimer Splunk de Linux hosts: all:!splunk_uf_Linux become: true become_user: root vars: splunk_dir: "/opt/splunk" tasks: - name: Arrêter tous les processus Splunk en cours d'exécution shell: "{{ splunk_dir }}/bin/splunk stop" ignore_errors: true - name: Désinstaller le service Splunk shell: "{{ splunk_dir }}/bin/splunk disable boot-start" - name: Supprimer le répertoire d'installation de Splunk file: path: "{{ splunk_dir }}" state: absent - name: Supprimer l'utilisateur Splunk et son groupe user: name: splunk state: absent ignore_errors: true - 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: "Shutdown VM" shell: shutdown -r now - name: Wait for the reboot and reconnect wait_for: port: 22 search_regex: OpenSSH delay: 10 timeout: 60 connection: local - name: Check the Uptime of the servers shell: "uptime" register: Uptime - debug: var=Uptime