<!--- Verify first that your issue is not already reported on GitHub -->
<!--- Also test if the latest release and devel branch are affected too -->
<!--- Complete *all* sections as described, this form is processed automatically -->

##### SUMMARY
<!--- Explain the problem briefly below -->
lineinfile repeatedly inserts the same line
Reversion of https://github.com/ansible/ansible/pull/49409

##### ISSUE TYPE
- Bug report

##### COMPONENT NAME
<!--- Write the short name of the module, plugin, task or feature below, use your best guess if unsure -->
lineinfile

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```paste below
ansible 2.8.2
  config file = /Users/stuart/git/productmadness/ansible/aws/atlassian/ansible.cfg
  configured module search path = ['/Users/stuart/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/2.8.2/libexec/lib/python3.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.7.4 (default, Jul  9 2019, 18:13:23) [Clang 10.0.1 (clang-1001.0.46.4)]
```

##### CONFIGURATION
<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
```paste below
DEFAULT_HOST_LIST(/Users/stuart/git/productmadness/ansible/aws/atlassian/ansible.cfg) = ['/Users/stuart/git/productmadness/ansible/aws/ansible_hosts.py']
HOST_KEY_CHECKING(/Users/stuart/git/productmadness/ansible/aws/atlassian/ansible.cfg) = False
```

##### OS / ENVIRONMENT
<!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. -->
master is OSX 10.14.5
Target is Centos 7.6.1810

##### STEPS TO REPRODUCE
<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->
use lineinfile with
insertafter and regexp
According to the docs if regexp matches insertafter is ignored
c.f. https://docs.ansible.com/ansible/latest/modules/lineinfile_module.html

viz
>The regular expression to look for in every line of the file.
>For state=present, the pattern to replace if found. Only the last line found will be replaced.
>For state=absent, the pattern of the line(s) to remove.
>If the regular expression is not matched, the line will be added to the file in keeping with insertbefore or insertafter settings.
>When modifying a line the regexp should typically match both the initial state of the line as well as its state after replacement by line to ensure idempotence.

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

    - name: Set JVM opts
      lineinfile:
        path: /opt/atlassian/crucible/bin/start.sh
        insertafter: '^#!/bin/sh'
        regexp: ^export FISHEYE_OPTS
        firstmatch: true
        line: export FISHEYE_OPTS="-Xmx4096m -Xms2048m"
```

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

##### EXPECTED RESULTS
<!--- Describe what you expected to happen when running the steps above -->
I expect that the line to be inserted after #!/bin/bash if it does not exist and to be left alone if it does


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

<!--- Paste verbatim command output between quotes -->
Evey time I run the playbook the line is added again after #!/bin/bash

<script src="https://gist.github.com/mutt13y/49c90c10430f4117d6bbbcb3e6e8a70e.js"></script>

```paste below

cat /opt/atlassian/crucible/bin/start.sh 
#!/bin/sh
export FISHEYE_OPTS="-Xmx4096m -Xms2048m"
export FISHEYE_OPTS="-Xmx4096m -Xms2048m"
export FISHEYE_OPTS="-Xmx4096m -Xms2048m"
export FISHEYE_OPTS="-Xmx4096m -Xms2048m"


case "`uname`" in
  Darwin*) if [ -z "$JAVA_HOME" ] ; then
```

choices: [ BOF, '*regex*' ]
    version_added: "1.1"
  create:
    description:
      - Used with C(state=present).
      - If specified, the file will be created if it does not already exist.
      - By default it will fail if the file is missing.
    type: bool
    default: no
  backup:
    description:
      - Create a backup file including the timestamp information so you can
        get the original file back if you somehow clobbered it incorrectly.
    type: bool
    default: no
  firstmatch:
    description:
      - Used with C(insertafter) or C(insertbefore).
      - If set, C(insertafter) and C(insertbefore) find a first line has regular expression matches.
    type: bool
    default: no
    version_added: "2.5"
  others:
    description:
      - All arguments accepted by the M(file) module also work here.
    type: str
extends_documentation_fragment:
    - files
    - validate
notes: