Puppet Class: cloud::volume::storage

Defined in:
manifests/volume/storage.pp

Overview

Parameters:

  • cinder_backends (Any) (defaults to: undef)
  • ks_keystone_internal_proto (Any) (defaults to: 'http')
  • ks_keystone_internal_port (Any) (defaults to: '5000')
  • ks_keystone_internal_host (Any) (defaults to: '127.0.0.1')
  • ks_cinder_password (Any) (defaults to: 'secrete')
  • glance_api_version (Any) (defaults to: '2')
  • cinder_rbd_pool (Any) (defaults to: $os_params::cinder_rbd_pool)
  • cinder_rbd_user (Any) (defaults to: $os_params::cinder_rbd_user)
  • cinder_rbd_secret_uuid (Any) (defaults to: $os_params::ceph_fsid)
  • cinder_rbd_conf (Any) (defaults to: '/etc/ceph/ceph.conf')
  • cinder_rbd_flatten_volume_from_snapshot (Any) (defaults to: false)
  • cinder_rbd_max_clone_depth (Any) (defaults to: '5')


52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'manifests/volume/storage.pp', line 52

class cloud::volume::storage(
  $cinder_backends                         = undef,
  $ks_keystone_internal_proto              = 'http',
  $ks_keystone_internal_port               = '5000',
  $ks_keystone_internal_host               = '127.0.0.1',
  $ks_cinder_password                      = 'secrete',
  # Deprecated parameters
  $glance_api_version                      = '2',
  $cinder_rbd_pool                         = $os_params::cinder_rbd_pool,
  $cinder_rbd_user                         = $os_params::cinder_rbd_user,
  $cinder_rbd_secret_uuid                  = $os_params::ceph_fsid,
  $cinder_rbd_conf                         = '/etc/ceph/ceph.conf',
  $cinder_rbd_flatten_volume_from_snapshot = false,
  $cinder_rbd_max_clone_depth              = '5'
) {

  include 'cloud::volume'

  include 'cinder::volume'

  if $cinder_backends {
    $rbd_backends = has_key($cinder_backends, 'rbd') ? {
      false   => merge({}, {}),
      default => $cinder_backends['rbd']
    }

    if has_key($cinder_backends, 'netapp') {
      $netapp_backends = $cinder_backends['netapp']
      create_resources('cloud::volume::backend::netapp', $netapp_backends)
    }
    else {
      $netapp_backends = { }
    }

    class { 'cinder::backends':
      enabled_backends => keys(merge($rbd_backends, $netapp_backends))
    }

    # Manage Volume types.
    # It allows to the end-user to choose from which backend he would like to provision a volume.
    # Cinder::Type requires keystone credentials
    Cinder::Type <| |> {
      os_tenant_name => 'services',
      os_username    => 'cinder',
      os_password    => $ks_cinder_password,
      os_auth_url    => "${ks_keystone_internal_proto}://${ks_keystone_internal_host}:${ks_keystone_internal_port}/v2.0"
    }
  }
  # For backward compatibility when not using multi-backend
  else {
    $rbd_backends = { 'DEFAULT' => { } }
  }

  if ! empty($rbd_backends) {
    create_resources('cloud::volume::backend::rbd', $rbd_backends,
      { rbd_pool                         => $cinder_rbd_pool,
        rbd_user                         => $cinder_rbd_user,
        rbd_secret_uuid                  => $cinder_rbd_secret_uuid,
        rbd_ceph_conf                    => $cinder_rbd_conf,
        rbd_flatten_volume_from_snapshot => $cinder_rbd_flatten_volume_from_snapshot,
        rbd_max_clone_depth              => $cinder_rbd_max_clone_depth })
  }
}