This repository was archived by the owner on Dec 20, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 174
refresh-mcollective-metadata cron job broken syntax #360
Copy link
Copy link
Open
Description
Line 31 of yaml.pp installs a cron job with broken syntax since switching from facter to puppet facts. The command is fine when run manually, but is broken in cron thanks to the use of the % character as a delimiter in the sed expression.
From man 5 crontab:
The ``sixth'' field (the rest of the line) specifies the command to be run. The entire command portion of the line, up to a newline or % character, will be executed by /bin/sh or by the shell specified in the SHELL variable of the crontab file. Percent-signs (%) in the command, unless escaped with backslash (\), will be changed into newline characters, and all data after the first % will be sent to the command as standard input.
Using @ instead should work fine.
Affected Puppet, Ruby, OS and module versions/distributions
- Puppet: 4.10.9
- Ruby: 2.3.1p112
- Distribution: Ubuntu 16.04
- Module version: 2.10.6
How to reproduce (e.g Puppet code you use)
Apply yaml.pp, wait 15 minutes, see error emailed by cron.
What are you seeing
/bin/sh: 1: Syntax error: Unterminated quoted string
What behaviour did you expect instead
Successful command execution and population of facts.yaml
Output log
Any additional information you'd like to impart
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels