main.yaml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. # Copyright 2020 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: install packages for slurm
  16. yum:
  17. name:
  18. - munge
  19. - mariadb
  20. - mariadb-devel
  21. - python3
  22. state: present
  23. tags: install
  24. - name: create munge key
  25. command: /usr/sbin/create-munge-key -f
  26. tags: install
  27. - name: Copy munge key
  28. copy:
  29. src: munge.key
  30. dest: /etc/munge
  31. owner: munge
  32. group: munge
  33. mode: 0400
  34. tags: install
  35. - name: Copy example Slurm Configuration - slurm.conf
  36. copy:
  37. src: slurm.conf
  38. dest: /etc/slurm/
  39. mode: 0644
  40. tags: install
  41. - name: create SLURM Group
  42. group:
  43. name: slurm
  44. state: present
  45. tags: install
  46. - name: Add the user 'slurm' with uid 6001 and a primary group of 'slurm'
  47. user:
  48. name: slurm
  49. comment: Slurm User Account
  50. uid: 6001
  51. group: slurm
  52. tags: install
  53. - name: create SLURM log directory
  54. file:
  55. path: /var/log/slurm
  56. state: directory
  57. owner: slurm
  58. group: slurm
  59. mode: 0755
  60. recurse: yes
  61. tags: install
  62. - name: give slurm user permission to spool
  63. file:
  64. path: /var/spool/slurm
  65. owner: slurm
  66. group: slurm
  67. state: directory
  68. mode: 0755
  69. recurse: yes
  70. - name: give slurm user permission to slurmctld
  71. file:
  72. path: /var/run/slurmctld.pid
  73. owner: slurm
  74. group: slurm
  75. mode: 0755
  76. state: touch
  77. - name: give slurm user permission to slurmd
  78. file:
  79. path: /var/run/slurmd.pid
  80. owner: slurm
  81. group: slurm
  82. mode: 0755
  83. state: touch
  84. - name: start munge service
  85. service:
  86. name: munge
  87. state: restarted
  88. enabled: yes
  89. tags: install