Przeglądaj źródła

etcd: unmask system container service before installing it

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Giuseppe Scrivano 7 lat temu
rodzic
commit
8b29fcfca4
1 zmienionych plików z 26 dodań i 0 usunięć
  1. 26 0
      roles/etcd/tasks/system_container.yml

+ 26 - 0
roles/etcd/tasks/system_container.yml

@@ -15,6 +15,32 @@
       {%- endif -%}
       {% endfor -%}
 
+- name: Check etcd system container package
+  command: >
+    atomic containers list --no-trunc -a -f container=etcd -f backend=ostree
+  register: etcd_result
+
+- name: Unmask etcd service
+  systemd:
+    name: etcd
+    state: stopped
+    enabled: yes
+    masked: no
+    daemon_reload: yes
+  register: task_result
+  failed_when: task_result|failed and 'could not' not in task_result.msg|lower
+  when: "'etcd' in etcd_result.stdout"
+
+- name: Disable etcd_container
+  systemd:
+    name: etcd_container
+    state: stopped
+    enabled: no
+    masked: yes
+    daemon_reload: yes
+  register: task_result
+  failed_when: task_result|failed and 'could not' not in task_result.msg|lower
+
 - name: Check for previous etcd data store
   stat:
     path: "{{ etcd_data_dir }}/member/"