configure_restd_leap.yml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. # Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. ---
  15. - name: Add leap src repo
  16. zypper_repository:
  17. name: "{{ src_repo_name }}"
  18. repo: "{{ src_repo_path }}"
  19. state: present
  20. autorefresh: yes
  21. - name: Install tar packages
  22. zypper:
  23. name: "{{ item }}"
  24. state: present
  25. with_items:
  26. - tar
  27. - bzip2
  28. - name: Install source slurm
  29. command: zypper --non-interactive si slurm
  30. changed_when: true
  31. - name: Find tar.bz2 slurm file name
  32. command: find "{{ slurm_src_package_path }}" -name "slurm*tar.bz2"
  33. changed_when: false
  34. register: slurm_tar_file
  35. - name: Set slurm tar file and folder path
  36. set_fact:
  37. slurm_tar_file: "{{ slurm_tar_file.stdout.split(slurm_src_package_path)[1] }}"
  38. slurm_folder_path: "{{ slurm_tar_file.stdout.split(slurm_src_package_path)[1].split('.tar')[0] }}"
  39. - name: Copy slurm tar file to lib folder
  40. copy:
  41. src: "{{ slurm_src_package_path }}{{ slurm_tar_file }}"
  42. dest: "{{ slurm_lib_path }}{{ slurm_tar_file }}"
  43. remote_src: true
  44. mode: preserve
  45. - name: Untar the slurm tar file
  46. command: tar --bzip -x -f "{{ slurm_lib_path }}{{ slurm_tar_file }}" "{{ slurm_folder_path }}/"
  47. changed_when: true
  48. args:
  49. chdir: "{{ slurm_lib_path }}"
  50. warn: false
  51. - name: Configure slurmrestd
  52. command: ./configure --prefix "{{ slurm_lib_path }}" --enable-slurmrestd --with-jwt=/usr/local
  53. changed_when: true
  54. args:
  55. chdir: "{{ slurm_lib_path }}{{ slurm_folder_path }}"
  56. - name: Execute make
  57. command: make
  58. changed_when: true
  59. register: make
  60. until: make is not failed
  61. retries: "{{ make_command_retries }}"
  62. args:
  63. chdir: "{{ slurm_lib_path }}{{ slurm_folder_path }}"
  64. - name: Execute make install
  65. command: make install
  66. changed_when: true
  67. register: make_install
  68. until: make_install is not failed
  69. retries: "{{ make_command_retries }}"
  70. args:
  71. chdir: "{{ slurm_lib_path }}{{ slurm_folder_path }}"
  72. - name: Check lib64 auth_jwt file path
  73. stat:
  74. path: "{{ slurm_lib64_auth_jwt_src }}/{{ auth_jwt_file_name }}"
  75. register: auth_jwt_lib64_path
  76. - name: Check lib auth_jwt file path
  77. stat:
  78. path: "{{ slurm_lib_auth_jwt_src }}/{{ auth_jwt_file_name }}"
  79. register: auth_jwt_lib_path
  80. - name: Copy lib64 auth_jwt files
  81. shell: "cp {{ slurm_lib64_auth_jwt_src }}/auth_jwt.* {{ slurm_lib64_auth_jwt_dest }}"
  82. changed_when: true
  83. when: auth_jwt_lib64_path.stat.exists
  84. - name: Copy lib auth_jwt files
  85. shell: "cp {{ slurm_lib_auth_jwt_src }}/auth_jwt.* {{ slurm_lib64_auth_jwt_dest }}"
  86. changed_when: true
  87. when: auth_jwt_lib_path.stat.exists
  88. - name: Check lib64 auth_jwt file path
  89. stat:
  90. path: "{{ slurm_lib64_libjwt_src }}/{{ libjwt_file_name }}"
  91. register: libjwt_lib64_path
  92. - name: Check lib auth_jwt file path
  93. stat:
  94. path: "{{ slurm_lib_libjwt_src }}/{{ libjwt_file_name }}"
  95. register: libjwt_lib_path
  96. - name: Copy lib64 libjwt files
  97. shell: "cp {{ slurm_lib64_libjwt_src }}/libjwt.* {{ slurm_lib64_libjwt_dest }}"
  98. changed_when: true
  99. when: libjwt_lib64_path.stat.exists
  100. - name: Copy lib libjwt files
  101. shell: "cp {{ slurm_lib_libjwt_src }}/libjwt.* {{ slurm_lib64_libjwt_dest }}"
  102. changed_when: true
  103. when: libjwt_lib_path.stat.exists