Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

refresh-mcollective-metadata cron job broken syntax #360

@jeffreyfroman-temboo

Description

@jeffreyfroman-temboo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions