Skip to content
Snippets Groups Projects
Commit 152666bd authored by Gin Tan's avatar Gin Tan
Browse files

Merge branch 'fixSemaphoreCount' into 'master'

Fix semaphore count

See merge request hpc-team/ansible_cluster_in_a_box!241
parents 7e04c529 8ad9fee0
No related branches found
No related tags found
1 merge request!241Fix semaphore count
Some programs, i.e. GAMESS, needs a larger number of system semaphores than provided by default.
This role creates a config file in /etc/sysctl.d/ that sets the value on startup, so that it is persistent after reboot
It also runs a Shell command so change has immediate effect: This is the default value for the role
echo 500 256000 64 10240 > /proc/sys/kernel/sem
We use a variable SEM_COUNT so users can override the default setting.
use
- { role: set_semaphore_count } #to use default value hardcoded inside main.yml, (as above)
or
- { role: set_semaphore_count, SEM_COUNT: "200 252000 24 20240" } #to use some other value (the ones here are nonsense for example only)
---
- name: set the value of the Semaphores
set_fact:
SEM_COUNT: "500 256000 64 10240"
when: SEM_COUNT is not defined
- name: test value
debug: msg="Value of semaphores is {{ SEM_COUNT }} " #"
- name: Place comment line in file
lineinfile:
path: /etc/sysctl.d/88-setSemaphore.conf
line: "#set large semaphore count. Needed for Gamess."
state: present
create: yes
owner: root
group: root
mode: "u+rwx,o=rx,g=rx"
become: true
become_user: root
- name: Place comment line in file
lineinfile:
path: /etc/sysctl.d/88-setSemaphore.conf
line: "#https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/tuning_and_optimizing_red_hat_enterprise_linux_for_oracle_9i_and_10g_databases/sect-oracle_9i_and_10g_tuning_guide-setting_semaphores-setting_semaphore_parameters "
state: present
become: true
become_user: root
- name: Place comment line in file
lineinfile:
path: /etc/sysctl.d/88-setSemaphore.conf
line: "kernel.sem={{ SEM_COUNT }}"
state: present
create: yes
owner: root
group: root
mode: "u+rwx,o=rx,g=rx"
become: true
become_user: root
- name: set semaphore count now
shell: "/usr/bin/echo {{ SEM_COUNT }} > /proc/sys/kernel/sem"
become: true
become_user: root
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment