Skip to content

Commit

Permalink
install custom slurm packages (#1)
Browse files Browse the repository at this point in the history
* Update main.yml

* Update defaults/main.yml

Co-authored-by: Bruno Travouillon <[email protected]>

* install custom packages

* install custom packages

* install custom packages

* add custom debain repositories

* install custom packages

* install custom packages

* fix typo dynamique vars

* fix the FQCN

* add configure custom repos

* add example of custom repo

* add new  README.md

Co-authored-by: Bruno Travouillon <[email protected]>

* remove custom package installtion

* remove condition slurm_apt_repository

* fix typo

* remove slurm_apt_repository condition

* remove slurm_apt_repository condition

* fix custom log directory creation

* move var to first part

* rename the var to static

* fix var

---------

Co-authored-by: Bruno Travouillon <[email protected]>
Co-authored-by: ahmed <[email protected]>
  • Loading branch information
3 people authored Apr 25, 2023
1 parent b713a8a commit 68c88a2
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 1 deletion.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ Slurm
=====

Install and configure a Slurm cluster on RHEL/CentOS or Debian/Ubuntu servers
To configure a custom Debian repository, define `slurm_configure_repos: true`.

Then, define the APT repositories with the URL to the GPG key.

# Example apt repository
slurm_apt_repository: "deb [trusted=yes] http://127.0.0.1/ubuntu/22.04/amd64/ ./"
# Example GPG key
slurm_gpg_key: 'http://127.0.0.1/ubuntu/22.04/amd64/GPG-KEY-slurm'
Define `slurm_apt_priority` to pin the priority of the repository (APT only). This is optional.

slurm_apt_priority: 900

Role Variables
--------------
Expand Down
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ slurmdbd_service_name: slurmdbd

slurm_start_services: true


# install from custom debian repos
slurm_configure_repos: false
#to setup custom systemd unit files
slurm_configure_systemd: false

Expand Down
4 changes: 4 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
- name: Include user creation tasks
ansible.builtin.include_tasks: user.yml
when: slurm_create_user

- name: Include Configure custom repositories
ansible.builtin.include_tasks: repositories-Debian.yml
when: slurm_configure_repos

- name: Include controller installation tasks
ansible.builtin.include_tasks: slurmctld.yml
Expand Down
26 changes: 26 additions & 0 deletions tasks/repositories-Debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
- name: Install GPG-KEY
ansible.builtin.apt_key:
url: "{{ slurm_gpg_key }}"
keyring: /etc/apt/trusted.gpg.d/slurm.gpg
when: slurm_gpg_key is defined

- name: Configure Slurm repository
ansible.builtin.copy:
content: "{{ slurm_apt_repository }}\n"
dest: /etc/apt/sources.list.d/slurm.list
mode: 0644

- name: Configure APT preferences for Slurm repository
ansible.builtin.copy:
content: |
Package: *
Pin: release o=SLURM
Pin-Priority: {{ slurm_apt_priority }}
dest: /etc/apt/preferences.d/priority-slurm
mode: 0644
when: slurm_apt_priority is defined

- name: "Update repository cache"
ansible.builtin.apt:
update_cache: yes
2 changes: 1 addition & 1 deletion templates/logrotate.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Slurm Logrotate Configuration
##
# TODO: this ignores the actual *LogFile values
{{ '/var/log/slurm-llnl' if __slurm_debian else '/var/log/slurm' }}/*.log {
{{ '/var/log/slurm-llnl' if (not slurm_configure_repos and __slurm_debian) else '/var/log/slurm' }}/*.log {
compress
missingok
nocopytruncate
Expand Down

0 comments on commit 68c88a2

Please sign in to comment.