

### SUMMARY
In SuSe SLES there is a file: /etc/vimrc. It contains ^M characters, like in line:  101 containing:
    map! <ESC>OM  ^M
When running module blockinfile on this file it removes the ^M characters.
The blockinfile just needs to adds some lines on the end of the file. Even when the lines are already there it removes the ^M characters.

It looks like that it reads the file and cannot handle the ^M characters and writes the buffer without the characters to the file.

##### ISSUE TYPE
- Module blockinfile

##### COMPONENT NAME
blockinfile

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```
ansible 2.4.2.0
  config file = None
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /bin/ansible
  python version = 2.7.5 (default, Aug  7 2019, 00:51:29) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]


```

##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
```paste below

```

##### OS / ENVIRONMENT
<!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. -->


##### STEPS TO REPRODUCE
<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->

<!--- Paste example playbooks or commands between quotes below -->
```yaml

```

<!--- HINT: You can paste gist.github.com links for larger files -->

##### EXPECTED RESULTS
<!--- Describe what you expected to happen when running the steps above -->


##### ACTUAL RESULTS
<!--- Describe what actually happened. If possible run with extra verbosity (-vvvv) -->

<!--- Paste verbatim command output between quotes -->
```paste below

```

- Whether the block should be there or not.
    type: str
    choices: [ absent, present ]
    default: present
  marker:
    description:
    - The marker line template.
    - C({mark}) will be replaced with the values C(in marker_begin) (default="BEGIN") and C(marker_end) (default="END").
    - Using a custom marker without the C({mark}) variable may result in the block being repeatedly inserted on subsequent playbook runs.
    type: str
    default: '# {mark} ANSIBLE MANAGED BLOCK'
  block:
    description:
    - The text to insert inside the marker lines.
    - If it is missing or an empty string, the block will be removed as if C(state) were specified to C(absent).
    type: str
    default: ''
    aliases: [ content ]
  insertafter:
    description:
    - If specified, the block will be inserted after the last match of specified regular expression.
    - A special value is available; C(EOF) for inserting the block at the end of the file.
    - If specified regular expression has no matches, C(EOF) will be used instead.
    type: str
    choices: [ EOF, '*regex*' ]
    default: EOF
  insertbefore:
    description:
    - If specified, the block will be inserted before the last match of specified regular expression.
    - A special value is available; C(BOF) for inserting the block at the beginning of the file.