lib/puppet_x/coi/jboss/provider/confignode.rb
# Getter for current status of resource
Getter for current status of resource
Getter for current status of resource
def ensure
    trace 'ensure'
    exists?
    if @data.nil?
      @property_hash[:ensure] = :absent
      traceout 'ensure()', :absent
      return :absent
    end
    if not @data['status'].nil?
      st = @data['status'].upcase
      if st == 'DISABLED'
        @property_hash[:ensure] = :disabled
        traceout 'ensure()', :disabled
        return :disabled
      end
      if ['RUNNING', 'STARTED'].include? st
        @property_hash[:ensure] = :running
        traceout 'ensure()', :running
        return :running
      else
        @property_hash[:ensure] = :stopped
        traceout 'ensure()', :stopped
        return :stopped
      end
    end
    if not @data['enabled'].nil?
      if @data['enabled']
        @property_hash[:ensure] = :enabled
        traceout 'ensure()', :enabled
        return :enabled
      else
        @property_hash[:ensure] = :disabled
        traceout 'ensure()', :disabled
        return :disabled
      end
    end
    if @data.length > 0
      @property_hash[:ensure] = :present
      traceout 'ensure()', :present
      return :present
    end
  end
def ensure trace 'ensure' exists? if @data . nil? @property_hash [ :ensure ] = :absent traceout 'ensure()' , :absent return :absent end if not @data [ 'status' ] . nil? st = @data [ 'status' ] . upcase if st == 'DISABLED' @property_hash [ :ensure ] = :disabled traceout 'ensure()' , :disabled return :disabled end if [ 'RUNNING' , 'STARTED' ] . include? st @property_hash [ :ensure ] = :running traceout 'ensure()' , :running return :running else @property_hash [ :ensure ] = :stopped traceout 'ensure()' , :stopped return :stopped end end if not @data [ 'enabled' ] . nil? if @data [ 'enabled' ] @property_hash [ :ensure ] = :enabled traceout 'ensure()' , :enabled return :enabled else @property_hash [ :ensure ] = :disabled traceout 'ensure()' , :disabled return :disabled end end if @data . length > 0 @property_hash [ :ensure ] = :present traceout 'ensure()' , :present return :present end end
Getter for current status of resource
Getter for current status of resource