Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-9357

Noop exec debug logging should include the command

    XMLWordPrintable

Details

    • Enhancement
    • Hide
      The exec resource will now print a debug message with the command, if checks prevent it from being executed.
      Also, if any of the :command, :onlyif, or :unless parameters are marked sensitive, all commands will be redacted from the log output.
      Show
      The exec resource will now print a debug message with the command, if checks prevent it from being executed. Also, if any of the :command, :onlyif, or :unless parameters are marked sensitive, all commands will be redacted from the log output.
    • Needs Assessment

    Description

      When running in noop mode, debug logging for exec resources includes e.g. the unless and onlyif commands, but it does not log the command that would be run, instead merely logging that it has not yet been run and should have been. Because an exec's command is frequently assembled using variable interpolation (and therefore can't be just read from the manifest conclusively), and because the resource will often have a custom title, users running with --noop --debug would likely benefit from seeing the command itself in debug output.

      There are other ways of getting this information, so it's not a big problem, but it would be a nice thing to have.

      % /opt/puppetlabs/puppet/bin/puppet apply --noop --debug -e "exec { 'example': command => '/bin/true', unless => '/bin/false', }"
      --- 8< ---
      Info: Applying configuration version '1544556833'
      Debug: Exec[example](provider=posix): Executing check '/bin/false'
      Debug: Executing: '/bin/false'
      Notice: /Stage[main]/Main/Exec[example]/returns: current_value 'notrun', should be ['0'] (noop)
      Debug: /Stage[main]/Main/Exec[example]: The container Class[Main] will propagate my refresh event
      Notice: Class[Main]: Would have triggered 'refresh' from 1 event
      Debug: Class[Main]: The container Stage[main] will propagate my refresh event
      Notice: Stage[main]: Would have triggered 'refresh' from 1 event
      Debug: Finishing transaction 47213377716240
      Debug: Storing state
      Debug: Pruned old state cache entries in 0.00 seconds
      Debug: Stored state in 0.01 seconds
      Notice: Applied catalog in 0.10 seconds
      --- 8< ---
      

      Attachments

        Activity

          People

            kris.bosland Kris Bosland
            chris.roddy Chris Roddy
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support