Sha256: eb3d95009f448307a07559053ec888f0906186343773ef6d21c119ce977f909d

Contents?: true

Size: 996 Bytes

Versions: 24

Compression:

Stored size: 996 Bytes

Contents

#
# Simple module for logging messages on the client-side


module Puppet
  Type.newtype(:notify) do
    @doc = "Sends an arbitrary message to the agent run-time log."

    apply_to_all

    newproperty(:message, :idempotent => false) do
      desc "The message to be sent to the log."
      def sync
        message = @sensitive ? 'Sensitive [value redacted]' : self.should
        case @resource["withpath"]
        when :true
          send(@resource[:loglevel], message)
        else
          Puppet.send(@resource[:loglevel], message)
        end
        return
      end

      def retrieve
        :absent
      end

      def insync?(is)
        false
      end

      defaultto { @resource[:name] }
    end

    newparam(:withpath) do
      desc "Whether to show the full object path."
      defaultto :false

      newvalues(:true, :false)
    end

    newparam(:name) do
      desc "An arbitrary tag for your own reference; the name of the message."
      isnamevar
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
puppet-5.5.22 lib/puppet/type/notify.rb
puppet-5.5.22-x86-mingw32 lib/puppet/type/notify.rb
puppet-5.5.22-x64-mingw32 lib/puppet/type/notify.rb
puppet-5.5.22-universal-darwin lib/puppet/type/notify.rb
puppet-5.5.21 lib/puppet/type/notify.rb
puppet-5.5.21-x86-mingw32 lib/puppet/type/notify.rb
puppet-5.5.21-x64-mingw32 lib/puppet/type/notify.rb
puppet-5.5.21-universal-darwin lib/puppet/type/notify.rb
puppet-5.5.20 lib/puppet/type/notify.rb
puppet-5.5.20-x86-mingw32 lib/puppet/type/notify.rb
puppet-5.5.20-x64-mingw32 lib/puppet/type/notify.rb
puppet-5.5.20-universal-darwin lib/puppet/type/notify.rb
puppet-5.5.19 lib/puppet/type/notify.rb
puppet-5.5.19-x86-mingw32 lib/puppet/type/notify.rb
puppet-5.5.19-x64-mingw32 lib/puppet/type/notify.rb
puppet-5.5.19-universal-darwin lib/puppet/type/notify.rb
puppet-5.5.18 lib/puppet/type/notify.rb
puppet-5.5.18-x86-mingw32 lib/puppet/type/notify.rb
puppet-6.4.5 lib/puppet/type/notify.rb
puppet-5.5.18-x64-mingw32 lib/puppet/type/notify.rb