def METHOD_NAME(modules, tmp_path):
    # Get a path to the temporary file
    tmp_file = tmp_path / "issue-2379-file-append.txt"
    # Write some data to it
    tmp_file.write_text(
        "hello\nworld\n"  # Some junk
        "#PermitRootLogin yes\n"  # Commented text
        "# PermitRootLogin yes\n"  # Commented text with space
    )
    # create the sls template
    template_lines = [
        "{}:".format(tmp_file),
        "  file.append:",
        "    - text: PermitRootLogin yes",
    ]
    template = "\n".join(template_lines)
    ret = modules.state.template_str(template)
    for state_run in ret:
        assert state_run.result is True
        assert "Appended 1 lines" in state_run.comment