saltstack / saltstack/salt

file.line does not work with "ensure" mode when file is empty or line is absent

Open
#54,466 17 comments 2 reactions 1 assignee View on GitHub

@xeacott is already working on this.

Since Oct 14, 2019.

bug pending-discussion
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Hello, as I can understand I have no chance to make sure that some line is in file with one task. So this is some kind of feature request.

file.line module is rather useless with mode ensure, it requires before/after. But I don't know the content of file and it may be absent or empty. I don't understand how you intend to use option create in mode ensure at all.

Please consider ansible module lineinfile for reference.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.