File: keystone_domain.rb

package info (click to toggle)
puppet-module-keystone 27.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,352 kB
  • sloc: ruby: 9,331; pascal: 301; python: 33; sh: 10; makefile: 10
file content (52 lines) | stat: -rw-r--r-- 1,403 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# LP#1408531
File.expand_path('../..', File.dirname(__FILE__)).tap { |dir| $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) }
File.expand_path('../../../../openstacklib/lib', File.dirname(__FILE__)).tap { |dir| $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) }

Puppet::Type.newtype(:keystone_domain) do

  desc <<-EOT
    This type can be used to manage
    keystone domains.
  EOT

  ensurable

  newparam(:name, :namevar => true) do
    newvalues(/\w+/)
  end

  newproperty(:enabled) do
    newvalues(/(t|T)rue/, /(f|F)alse/, true, false )
    defaultto(true)
    munge do |value|
      value.to_s.downcase.to_sym
    end
  end

  newproperty(:description)

  newproperty(:is_default) do
    desc <<-EOT
      If this is true, this is the default domain used for v2.0 requests when the domain
      is not specified, or used by v3 providers if no other domain is specified.  The id
      of this domain will be written to the keystone config identity/default_domain_id
      value.
    EOT
    newvalues(/(t|T)rue/, /(f|F)alse/, true, false )
    defaultto(false)
    munge do |value|
      value.to_s.downcase.to_sym
    end
  end

  newproperty(:id) do
    validate do |v|
      raise(Puppet::Error, 'This is a read only property')
    end
  end

  # we should not do anything until the keystone service is started
  autorequire(:anchor) do
    ['keystone::service::end']
  end
end