fatbox/salt — comment on commit e640764e2173335fcf6970b3f98e836ab737e1b3
File:  line 0
By whiteinge:

This change will miss edits on files that contain both "before" and "after". It should always attempt the edit if "before" appears. E.g., the default ``/etc/yum.repos.d/epel.repo`` file contains several ``enabled=0`` lines and one ``enabled=1`` line but the edit is never attempted.

My inclination is to revert this change and to add docs that specify if a pattern needs to be anchored it should be done in the ``limit`` argument. So your use case would look something like the following. Does that work for you?

```yaml

nsswitch_passwd:
file:
- sed
- name: /etc/nsswitch.conf
- before: 'ldap'
- after: ''
- limit: '^passwd:'
```