Skip to content

Commit 04e622f

Browse files
committed
install slurm_stats during fatimage and skip during site
1 parent 999584f commit 04e622f

File tree

5 files changed

+43
-33
lines changed

5 files changed

+43
-33
lines changed

ansible/fatimage.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,11 @@
152152
tasks_from: install.yml
153153
when: "'opensearch' in group_names"
154154

155-
# slurm_stats - nothing to do
155+
- import_role:
156+
name: slurm_stats
157+
tasks_from: install.yml
158+
when: "'slurm_stats' in group_names"
159+
156160
- import_role:
157161
name: filebeat
158162
tasks_from: install.yml

ansible/monitoring.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
tasks:
2222
- include_role:
2323
name: slurm_stats
24+
tasks_from: "{{ 'configure.yml' if appliances_mode == 'configure' else 'main.yml' }}"
2425

2526
- name: Deploy filebeat
2627
hosts: filebeat
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
3+
- name: Create a directory to house the log files
4+
file:
5+
state: directory
6+
path: /var/log/slurm-stats
7+
become: true
8+
9+
- name: Create cron job
10+
cron:
11+
name: Generate slurm stats
12+
minute: "*/5"
13+
user: root
14+
# NOTE: lasttimestamp is stored at /root/lasttimestamp
15+
job: "TZ=UTC /opt/slurm-tools/bin/slurm-stats >> /var/log/slurm-stats/finished_jobs.json"
16+
cron_file: slurm-stats
17+
become: true
18+
19+
- name: Setup log rotate
20+
copy:
21+
content: |
22+
# WARNING: This file is managed by ansible, do not modify.
23+
/var/log/slurm-stats/finished_jobs.json {
24+
{{ slurm_stats_log_rotate_content_frequency }}
25+
rotate {{ slurm_stats_log_rotate_content_rotate }}
26+
compress
27+
delaycompress
28+
}
29+
dest: /etc/logrotate.d/slurm-stats
30+
become: true
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
3+
- name: Setup slurm tools
4+
include_role:
5+
name: slurm_tools
Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,4 @@
11
---
22

3-
- name: Setup slurm tools
4-
include_role:
5-
name: slurm_tools
6-
7-
- name: Create a directory to house the log files
8-
file:
9-
state: directory
10-
path: /var/log/slurm-stats
11-
become: true
12-
13-
- name: Create cron job
14-
cron:
15-
name: Generate slurm stats
16-
minute: "*/5"
17-
user: root
18-
# NOTE: lasttimestamp is stored at /root/lasttimestamp
19-
job: "TZ=UTC /opt/slurm-tools/bin/slurm-stats >> /var/log/slurm-stats/finished_jobs.json"
20-
cron_file: slurm-stats
21-
become: true
22-
23-
- name: Setup log rotate
24-
copy:
25-
content: |
26-
# WARNING: This file is managed by ansible, do not modify.
27-
/var/log/slurm-stats/finished_jobs.json {
28-
{{ slurm_stats_log_rotate_content_frequency }}
29-
rotate {{ slurm_stats_log_rotate_content_rotate }}
30-
compress
31-
delaycompress
32-
}
33-
dest: /etc/logrotate.d/slurm-stats
34-
become: true
3+
- include_tasks: install.yml
4+
- include_tasks: configure.yml

0 commit comments

Comments
 (0)