diff --git a/defaults/main.yml b/defaults/main.yml index c90980b..6edf9be 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -180,6 +180,8 @@ pam_use_namespace: False pam_tmp_inst_dir: /l/tmp-inst/ pam_var_tmp_inst_dir: /l/vartmp_inst/ +# template in a file to manage slurm logs via rsyslog +slurm_manage_rsyslog_conf: True # sysctl settings from slurm htc guide. slurm_manage_sysctl: True slurm_sysctl_core_somaxconn: 4096 # 128 is the default in el7 diff --git a/handlers/main.yml b/handlers/main.yml index 9804aa4..7686088 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -22,3 +22,7 @@ - name: restart slurmdbd service: name=slurmdbd state=restarted when: slurm_accounting_storage_host == ansible_hostname + + - name: Restart rsyslog + service: name=rsyslog state=restarted + diff --git a/tasks/common.yml b/tasks/common.yml index 43ed258..c03bdfb 100644 --- a/tasks/common.yml +++ b/tasks/common.yml @@ -44,6 +44,8 @@ - name: write all slurm logs handled by rsyslog to one file template: src=slurm_rsyslog.conf dest=/etc/rsyslog.d/10_slurm_rsyslog.conf owner=root mode=0644 backup=yes + notify: Restart rsyslog + when: slurm_manage_rsyslog_conf - name: configure logrotate to rotate slurm_logs in slurm_log_dir template: src=slurm_logrotate.j2 dest=/etc/logrotate.d/slurm owner=root mode=0644 backup=no diff --git a/tests/test.yml b/tests/test.yml index 97eae2e..76bbe15 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -28,3 +28,4 @@ pre_tasks: - debug: var=group_names + - package: name=rsyslog state=present