pyinfra icon indicating copy to clipboard operation
pyinfra copied to clipboard

Cronjobs/line replacements ending `2>&1` break

Open Fizzadar opened this issue 1 year ago • 0 comments

Describe the bug

A clear and concise description of what the bug is.

When ending a line replacement with 2>&1 the line is not replaced properly and a broken line, growing each deploy, is instead. Repro below.

To Reproduce

Steps to reproduce the behavior, please include where possible:

files.line(
    name="Ensure step cron",
    path="/usr/lib/cron/tabs/root",
    line="/usr/local/bin/step",
    replace="0 * * * * /usr/local/bin/step ca renew --root ca.crt --ca-url https://ca.com mtls.crt mtls.key >> /tmp/step-renew.log 2&>1",
)

Expected behavior

A clear and concise description of what you expected to happen.

Replace the line properly

Fizzadar avatar Mar 03 '23 05:03 Fizzadar