HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //var/cache/puppet/lib/puppet/type/consul_token.rb
Puppet::Type.newtype(:consul_token) do
  desc <<-'EOD'
  Manages a v2 Consul token
  EOD
  ensurable

  newparam(:name, namevar: true) do
    desc 'Name of the token'
    validate do |value|
      raise ArgumentError, 'Token name must be a string' unless value.is_a?(String)
    end
  end

  newproperty(:description) do
    desc 'Description of the token'
    validate do |value|
      raise ArgumentError, 'Description must be a string' unless value.is_a?(String)
    end
  end

  newproperty(:accessor_id) do
    desc 'Accessor ID of the token'
    validate do |value|
      raise ArgumentError, 'Accessor ID must be a string' unless value.is_a?(String)
    end
  end

  newproperty(:secret_id) do
    desc 'Secret ID of the token'
    validate do |value|
      raise ArgumentError, 'Secret ID must be a string' unless value.is_a?(String)
    end

    defaultto ''
  end

  newproperty(:policies_by_name, array_matching: :all) do
    desc 'List of policy names assigned to the token'
    validate do |value|
      raise ArgumentError, 'Policy name list must be an array of strings' unless value.is_a?(String)
    end

    defaultto []
  end

  newproperty(:policies_by_id, array_matching: :all) do
    desc 'List of policy IDs assigned to the token'
    validate do |value|
      raise ArgumentError, 'Policy ID list must be an array of strings' unless value.is_a?(String)
    end

    defaultto []
  end

  newparam(:acl_api_token) do
    desc 'Token for accessing the ACL API'
    validate do |value|
      raise ArgumentError, 'ACL API token must be a string' unless value.is_a?(String)
    end
    defaultto ''
  end

  newparam(:protocol) do
    desc 'consul protocol'
    newvalues(:http, :https)
    defaultto :http
  end

  newparam(:port) do
    desc 'consul port'
    defaultto 8500
    validate do |value|
      raise ArgumentError, 'The port number must be a number' unless value.is_a?(Integer)
    end
  end

  newparam(:hostname) do
    desc 'consul hostname'
    validate do |value|
      raise ArgumentError, 'The hostname must be a string' unless value.is_a?(String)
    end
    defaultto 'localhost'
  end

  newparam(:api_tries) do
    desc 'number of tries when contacting the Consul REST API'
    defaultto 3
    validate do |value|
      raise ArgumentError, 'Number of API tries must be a number' unless value.is_a?(Integer)
    end
  end

  autorequire(:service) do
    ['consul']
  end
end