Browse Source

Merge pull request #243 from VishnupriyaKrish/devel

Issue #240: Fix for skipping slurm RPM task while executing for second time
Lucas A. Wilson 4 năm trước cách đây
mục cha
commit
4932b6a6fe

+ 13 - 10
roles/slurm_manager/tasks/main.yml

@@ -63,6 +63,15 @@
     - "{{ dev_tools }}"
   tags: install
 
+- name: Verify if slurm is installed
+  shell: rpm -qa | grep slurm
+  ignore_errors: true
+  register: verify_result
+  changed_when: no
+  failed_when: no
+  args:
+    warn: no
+
 - name: Create temporary download folder for slurm
   file:
     path: "{{ tmp_path }}"
@@ -70,6 +79,7 @@
     group: slurm
     mode: "{{ tmp_mode }}"
     state: directory
+  when: verify_result.rc != 0
 
 - name: Download slurm source
   get_url:
@@ -78,19 +88,12 @@
     checksum: "{{ slurm_md5 }}"
     validate_certs: no
   tags: install
+  when: verify_result.rc != 0
 
 - name: Build slurm rpms
   command: rpmbuild -ta "{{ rpmbuild_path }}" --with mysql
   changed_when: false
-  args:
-    warn: no
-
-- name: Verify package md5
-  shell: rpm -qa | grep slurm
-  ignore_errors: true
-  register: verify_result
-  changed_when: no
-  failed_when: no
+  when: verify_result.rc != 0
   args:
     warn: no
 
@@ -234,4 +237,4 @@
   fetch:
     src: "{{ slurm_confpth }}"
     dest: "{{ buffer_path }}"
-    flat: true
+    flat: true

+ 1 - 1
roles/slurm_start_services/tasks/main.yml

@@ -44,7 +44,7 @@
 - name: Start slurmctld on manager
   service:
     name: slurmctld
-    state: started
+    state: restarted
   tags: install
 
 - name: Show cluster if exists

+ 12 - 9
roles/slurm_workers/tasks/main.yml

@@ -69,6 +69,15 @@
     - "{{ dev_tools }}"
   tags: install
 
+- name: Verify if slurm is installed
+  shell: rpm -qa | grep slurm
+  ignore_errors: true
+  register: verify_result
+  changed_when: no
+  failed_when: no
+  args:
+    warn: no
+
 - name: Create temporary download folder for slurm
   file:
     path: "{{ tmp_path }}"
@@ -76,6 +85,7 @@
     group: slurm
     mode: "{{ tmp_mode }}"
     state: directory
+  when: verify_result.rc != 0
 
 - name: Download slurm source
   get_url:
@@ -84,19 +94,12 @@
     checksum: "{{ slurm_md5 }}"
     validate_certs: no
   tags: install
+  when: verify_result.rc != 0
 
 - name: Build slurm rpms
   command: rpmbuild -ta "{{ rpmbuild_path }}" --with mysql
   changed_when: false
-  args:
-    warn: no
-
-- name: Verify package md5
-  shell: rpm -qa | grep slurm
-  ignore_errors: true
-  register: verify_result
-  changed_when: no
-  failed_when: no
+  when: verify_result.rc != 0
   args:
     warn: no