diff --git a/roles/calculateNhcConfig/tasks/main.yml b/roles/calculateNhcConfig/tasks/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..b6f9f9f7e6c0ce8de690265995faeab47328879e --- /dev/null +++ b/roles/calculateNhcConfig/tasks/main.yml @@ -0,0 +1,8 @@ +--- +- name: "Templating nhc.conf" + template: src=nhc.conf.j2 dest=/tmp/nhc.conf owner=root group=root mode=644 + sudo: true + +- name: fetch nhc.conf + fetch: src=/tmp/nhc.conf dest=files/nhc.conf flat=yes + diff --git a/roles/calculateNhcConfig/templates/nhc.conf.j2 b/roles/calculateNhcConfig/templates/nhc.conf.j2 new file mode 100644 index 0000000000000000000000000000000000000000..a5921218b83415835be2f8c168520bd9d7b05866 --- /dev/null +++ b/roles/calculateNhcConfig/templates/nhc.conf.j2 @@ -0,0 +1,29 @@ + + +####################################################################### +### +### Filesystem checks +### +# * || check_fs_mount_rw -t "fuse.glusterfs" -s "mgmt0:/gv" -f "/glusterVolume" + * || check_fs_used / 90% +# * || check_fs_used /glusterVolume 90% + * || check_fs_iused / 100% +# * || check_fs_iused /glusterVolume 100% + + +####################################################################### +### +### Hardware checks +### + * || check_hw_cpuinfo 1 1 1 +# * || check_hw_physmem 4048416kB 4048416kB 3% + * || check_hw_swap 0kB 0kB 3% + * || check_hw_eth eth0 + * || check_hw_eth lo + + +####################################################################### +### +### Process checks +### + * || check_ps_service -S -u root sshd diff --git a/roles/slurm-common/tasks/installNhc.yml b/roles/slurm-common/tasks/installNhc.yml index 8889a929be9c6956ca8ef19d8fd6623b4024eef9..1b093c6d2964dc1b894e626c17715dd97ccdff81 100644 --- a/roles/slurm-common/tasks/installNhc.yml +++ b/roles/slurm-common/tasks/installNhc.yml @@ -47,20 +47,7 @@ template: dest=/etc/logrotate.d/nhc src=nhclog.j2 mode=644 sudo: true -- name: check configure file - shell: ls {{ nhc_dir }}/etc/nhc/{{ nhc_config_file }} - ignore_errors: true - register: generate_nhc_config_file - -- name: generate config file - shell: "{{ nhc_dir }}/sbin/nhc-genconf -c {{ nhc_dir }}/etc/nhc/{{ nhc_config_file }} CONFDIR={{ nhc_dir }}/etc/nhc" - sudo: true - ignore_errors: true - when: generate_nhc_config_file - -- name: config file extension - lineinfile: dest="{{ nhc_dir }}/etc/nhc/{{ nhc_config_file }}" line="{{ item }}" - with_items: - nhc_user_conf - sudo: true - when: nhc_user_conf is defined and generate_nhc_config_file \ No newline at end of file +- name: install nhc config file + copy: src=nhc.conf dest={{ nhc_dir }}/etc/nhc/{{ nhc_config_file }} + become: true + become_user: root