From ef44317066a5424fd55ef10602dea97db1a9981a Mon Sep 17 00:00:00 2001
From: Simon Michnowicz <simon.michnowicz@monash.edu>
Date: Thu, 25 Jul 2019 18:28:55 +1000
Subject: [PATCH] sets file via a sysconf conf file

Former-commit-id: e857e4097b12276a1e834a5949bec5fc1d2c467f
---
 roles/set_semaphore_count/tasks/main.yml | 35 +++++++++++++++++++++---
 1 file changed, 31 insertions(+), 4 deletions(-)

diff --git a/roles/set_semaphore_count/tasks/main.yml b/roles/set_semaphore_count/tasks/main.yml
index a8e975f5..01203f6d 100644
--- a/roles/set_semaphore_count/tasks/main.yml
+++ b/roles/set_semaphore_count/tasks/main.yml
@@ -5,13 +5,40 @@
   when: SEM_COUNT is not defined
 - name: test value
   debug: msg="Value of semaphores is {{ SEM_COUNT }} "  #"
-- name: Template set_semaphores.service file
-  template: src=set_semaphores.service.j2 dest=/etc/systemd/system/set_semaphores.service
+- 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: enable and start set_semaphores service
-  service: name="set_semaphores" state=started enabled=true
+     
+- 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
 
-- 
GitLab