Hi,
I need help of Ansible lineinfile module with a variable based on hostname.
Here is what I have for the task:
On server vccs7ap01:
- name: ulimits - find sidadm on the server
shell: hostname | sed 's/vc//' | sed 's/ap[0-9][0-9]//g' | sed
's/$/adm/'
register: sidadm
- name: ulimits - add sidadm soft value to limits file
lineinfile:
path: /etc/security/limits.conf
regexp: '^sidadm.stdout\ soft'
line: "@sidadm.stdout\ soft 65536"
- name: ulimits - add sidadm hard value to limits file
lineinfile:
path: /etc/security/limits.conf
regexp: '^sidadm.stdout\ hard'
line: "@sidadm.stdout\ hard 65536"
After ran the playbook, change was made to /etc/security/limits.conf:
@sidadm.stdout soft 65536
@sidadm.stdout hard 65536
but I would like to have the entries:
cs7adm soft 65536
cs7adm hard 65536
Thanks in advance.
Frank
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/d3fca17a-e73e-40fe-8c3a-967017991a50n%40googlegroups.com.