Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

Ansible Playbook keeps adding ^M to my files

$
0
0

I have the below ansible playbook where i am identifying a string in a file and replacing it with another

---- name: Ansible Playbook  hosts: webserver1  remote_user: user45  tasks:  - name: Replacing content with other    lineinfile:     path: /home/user45/run.sh     regexp: '^(.*)DEBUG=(.*)$'     line: 'DEBUG=ON'

the above works, but it adds ^M to the end of every other line in that file and every blank line

From what I have read online this normally occurs when you copy and paste from Windows to Linux but i typed this out manually so i am kind of stumped

Playbook is running on Linux Redhat 7


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>