I have the latest version of Ansible and I keep getting the following stack trace in lineinfile module, Also i have copied my playbook below.
Stacktrace:
fatal: [d7] => failed to parse: Traceback (most recent call last):
File “/root/.ansible/tmp/ansible-1363200342.59-196252252580469/lineinfile”, line 1031, in
main()
File “/root/.ansible/tmp/ansible-1363200342.59-196252252580469/lineinfile”, line 270, in main
params[‘insertafter’], params[‘insertbefore’], create, backup)
File “/root/.ansible/tmp/ansible-1363200342.59-196252252580469/lineinfile”, line 144, in present
mre = re.compile(regexp)
File “/usr/lib64/python2.6/re.py”, line 190, in compile
return _compile(pattern, flags)
File “/usr/lib64/python2.6/re.py”, line 245, in _compile
raise error, v # invalid expression
sre_constants.error: nothing to repeat
fatal: [d8] => failed to parse: Traceback (most recent call last):
File “/root/.ansible/tmp/ansible-1363200342.59-246123346146030/lineinfile”, line 1031, in
main()
File “/root/.ansible/tmp/ansible-1363200342.59-246123346146030/lineinfile”, line 270, in main
params[‘insertafter’], params[‘insertbefore’], create, backup)
File “/root/.ansible/tmp/ansible-1363200342.59-246123346146030/lineinfile”, line 144, in present
mre = re.compile(regexp)
File “/usr/lib64/python2.6/re.py”, line 190, in compile
return _compile(pattern, flags)
File “/usr/lib64/python2.6/re.py”, line 245, in _compile
raise error, v # invalid expression
sre_constants.error: nothing to repeat
FATAL: all hosts have already failed – aborting
Playbook:
-
name: Add Hardlimit
lineinfile: dest=/etc/security/limits.conf regexp=‘* hard nofile 100000’ line=‘* hard nofile 100000’ state=present
only_if: ‘$is_centos’
tags: -
addlimits
-
name: Add Hardlimit
lineinfile: dest=/etc/security/limits.conf regexp=‘* soft nofile 100000’ line=‘* soft nofile 100000’ state=present
only_if: ‘$is_centos’
tags: -
addlimits
-
name: Add Hardlimit
lineinfile: dest=/etc/security/limits.conf regexp=‘root hard nofile 100000’ line=‘* hard nofile 100000’ state=present
only_if: ‘$is_centos’
tags: -
addlimits
-
name: Add Hardlimit
lineinfile: dest=/etc/security/limits.conf regexp=‘root soft nofile 100000’ line=‘* soft nofile 100000’ state=present
only_if: ‘$is_centos’
tags: -
addlimits
Regards,–
Kavin Kankeshwar