From f37265373453e7791d436003bcc866a6c5d9c334 Mon Sep 17 00:00:00 2001
From: Franck Bebel <franck.bebel@ouidou.fr>
Date: Wed, 27 May 2020 17:03:11 +0200
Subject: [PATCH] [devops] put consul as vitam service

---
 deployment/roles/uninstall/tasks/consul.yml   | 29 -------------------
 .../roles/uninstall/tasks/vitam-service.yml   | 29 +++++++++++++++++++
 deployment/uninstall.yml                      |  2 +-
 3 files changed, 30 insertions(+), 30 deletions(-)
 delete mode 100644 deployment/roles/uninstall/tasks/consul.yml
 create mode 100644 deployment/roles/uninstall/tasks/vitam-service.yml

diff --git a/deployment/roles/uninstall/tasks/consul.yml b/deployment/roles/uninstall/tasks/consul.yml
deleted file mode 100644
index 7d105372..00000000
--- a/deployment/roles/uninstall/tasks/consul.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-
----
-# tasks file for vitam-consul-uninstall
-- name: Stop vitam service
-  systemd:
-    name: "vitam-{{ service_name }}"
-    state: stopped
-  ignore_errors: yes
-
-- name: Uninstall vitam service
-  yum:
-    name: "vitam-{{ service_name }}"
-    state: absent
-
-- name: Delete file system of consul
-  file:
-    name: "{{ item }}"
-    state: absent
-  with_items:
-    - "/vitam/app/{{ service_name }}"
-    - "/vitam/bin/{{ service_name }}"
-    - "/vitam/conf/{{ service_name }}"
-    - "/vitam/data/{{ service_name }}"
-    - "/vitam/defaults/{{ service_name }}"
-    - "/vitam/lib/{{ service_name }}"
-    - "/vitam/log/{{ service_name }}"
-    - "/vitam/run/{{ service_name }}"
-    - "/vitam/script/{{ service_name }}"
-    - "/vitam/tmp/{{ service_name }}"
diff --git a/deployment/roles/uninstall/tasks/vitam-service.yml b/deployment/roles/uninstall/tasks/vitam-service.yml
new file mode 100644
index 00000000..38dc697e
--- /dev/null
+++ b/deployment/roles/uninstall/tasks/vitam-service.yml
@@ -0,0 +1,29 @@
+
+---
+# tasks file for vitam-service-uninstall
+- name: Stop vitam service
+  systemd:
+    name: "vitam-{{ service_name }}"
+    state: stopped
+  ignore_errors: yes
+
+- name: Uninstall vitam service
+  yum:
+    name: "vitam-{{ service_name }}"
+    state: absent
+
+- name: Delete file system of consul
+  file:
+    name: "{{ vitam_defaults.folder.root_path }}/{{ item }}/{{ service_name }}"
+    state: absent
+  with_items:
+    - app
+    - bin
+    - conf
+    - data
+    - defaults
+    - lib
+    - log
+    - run
+    - script
+    - tmp
diff --git a/deployment/uninstall.yml b/deployment/uninstall.yml
index ff548628..763b49f8 100644
--- a/deployment/uninstall.yml
+++ b/deployment/uninstall.yml
@@ -20,7 +20,7 @@
     - uninstall
   vars:
     service_name: consul
-    uninstaller_type: consul
+    uninstaller_type: vitam-service
   tags:
     - consul
     - zone-vitamui-infra
-- 
GitLab