I am having a requirement where I need to replace/comment a line from 
rsyslog.conf file 
I am unable to correctly state the regexp. Please Help.

INADEQUATE INFORMATION AVAILABLE ONLINE.

I have been testing the following script which is failing:


YAML using "lineinfile"
---
- name: Comment out *.*@10.1.0.100 line in /etc/rsyslog.conf
  lineinfile:
      path: /etc/rsyslog.conf
      regexp: '^*\.*@10\.1\.0\.100)'
      line: '# *.* @10.1.0.100'


YAML using "replace"
---

- name: Comment out *.*@10.1.0.100 line in /etc/rsyslog.conf
  replace:
      path: /etc/rsyslog.conf
      regexp: '*.* @10.1.0.100'
      replace: '# *.* @10.1.0.100'
      

[image: ansible_issue.PNG] <about:invalid#zClosurez>


PLEASE HELP. 
####################################################################################
## CHECKED WITH ANSIBLE 2.6 DOCUMENTATION. FOLLOWED THE GIVEN INFORMATION. 
#####
## YET HAVING ISSUE WITH PARSING THE "REGEXP" and "REPLACE"ing              
                   #####
####################################################################################

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/255d4307-4522-49ec-af91-ab119b9f6d21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to