Puppet Class: profile::openstack::base::cinder::backup

Defined in:
modules/profile/manifests/openstack/base/cinder/backup.pp

Overview

Parameters:

  • version (String[1]) (defaults to: lookup('profile::openstack::base::version'))
  • openstack_controllers (Array[Stdlib::Fqdn]) (defaults to: lookup('profile::openstack::base::openstack_controllers'))
  • keystone_fqdn (Stdlib::Fqdn) (defaults to: lookup('profile::openstack::base::keystone_api_fqdn'))
  • auth_port (Stdlib::Port) (defaults to: lookup('profile::openstack::base::keystone::auth_port'))
  • region (String[1]) (defaults to: lookup('profile::openstack::base::region'))
  • db_user (String[1]) (defaults to: lookup('profile::openstack::base::cinder::db_user'))
  • db_name (String[1]) (defaults to: lookup('profile::openstack::base::cinder::db_name'))
  • db_pass (String[1]) (defaults to: lookup('profile::openstack::base::cinder::db_pass'))
  • ldap_user_pass (String[1]) (defaults to: lookup('profile::openstack::base::ldap_user_pass'))
  • db_host (Stdlib::Fqdn) (defaults to: lookup('profile::openstack::base::cinder::db_host'))
  • api_bind_port (Stdlib::Port) (defaults to: lookup('profile::openstack::base::cinder::api_bind_port'))
  • ceph_pool (String[1]) (defaults to: lookup('profile::openstack::base::cinder::ceph_pool'))
  • ceph_rbd_client_name (String[1]) (defaults to: lookup('profile::openstack::base::cinder::ceph_rbd_client_name'))
  • rabbit_user (String[1]) (defaults to: lookup('profile::openstack::base::nova::rabbit_user'))
  • rabbit_pass (String[1]) (defaults to: lookup('profile::openstack::base::nova::rabbit_pass'))
  • libvirt_rbd_cinder_uuid (String[1]) (defaults to: lookup('profile::ceph::client::rbd::libvirt_rbd_cinder_uuid'))
  • active (Boolean) (defaults to: lookup('profile::openstack::base::cinder::backup::active'))
  • backup_path (Stdlib::Unixpath) (defaults to: lookup('profile::openstack::base::cinder::backup::path'))
  • lvm_pv_units (Array[Stdlib::Unixpath]) (defaults to: lookup('profile::openstack::base::cinder::backup::lvm::pv_units'))
  • lvm_vg_name (String[1]) (defaults to: lookup('profile::openstack::base::cinder::backup::lvm::vg_name'))
  • lvm_lv_name (String[1]) (defaults to: lookup('profile::openstack::base::cinder::backup::lvm::lv_name'))
  • lvm_lv_size (String[1]) (defaults to: lookup('profile::openstack::base::cinder::backup::lvm::lv_size'))
  • lvm_lv_format (String[1]) (defaults to: lookup('profile::openstack::base::cinder::backup::lvm::lv_format'))
  • user (String[1]) (defaults to: lookup('profile::openstack::base::cinder::backup::user'))


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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'modules/profile/manifests/openstack/base/cinder/backup.pp', line 1

class profile::openstack::base::cinder::backup (
    String[1]               $version                 = lookup('profile::openstack::base::version'),
    Array[Stdlib::Fqdn]     $openstack_controllers   = lookup('profile::openstack::base::openstack_controllers'),
    Stdlib::Fqdn            $keystone_fqdn           = lookup('profile::openstack::base::keystone_api_fqdn'),
    Stdlib::Port            $auth_port               = lookup('profile::openstack::base::keystone::auth_port'),
    String[1]               $region                  = lookup('profile::openstack::base::region'),
    String[1]               $db_user                 = lookup('profile::openstack::base::cinder::db_user'),
    String[1]               $db_name                 = lookup('profile::openstack::base::cinder::db_name'),
    String[1]               $db_pass                 = lookup('profile::openstack::base::cinder::db_pass'),
    String[1]               $ldap_user_pass          = lookup('profile::openstack::base::ldap_user_pass'),
    Stdlib::Fqdn            $db_host                 = lookup('profile::openstack::base::cinder::db_host'),
    Stdlib::Port            $api_bind_port           = lookup('profile::openstack::base::cinder::api_bind_port'),
    String[1]               $ceph_pool               = lookup('profile::openstack::base::cinder::ceph_pool'),
    String[1]               $ceph_rbd_client_name    = lookup('profile::openstack::base::cinder::ceph_rbd_client_name'),
    String[1]               $rabbit_user             = lookup('profile::openstack::base::nova::rabbit_user'),
    String[1]               $rabbit_pass             = lookup('profile::openstack::base::nova::rabbit_pass'),
    String[1]               $libvirt_rbd_cinder_uuid = lookup('profile::ceph::client::rbd::libvirt_rbd_cinder_uuid'),
    Boolean                 $active                  = lookup('profile::openstack::base::cinder::backup::active'),
    Stdlib::Unixpath        $backup_path             = lookup('profile::openstack::base::cinder::backup::path'),
    Array[Stdlib::Unixpath] $lvm_pv_units            = lookup('profile::openstack::base::cinder::backup::lvm::pv_units'),
    String[1]               $lvm_vg_name             = lookup('profile::openstack::base::cinder::backup::lvm::vg_name'),
    String[1]               $lvm_lv_name             = lookup('profile::openstack::base::cinder::backup::lvm::lv_name'),
    String[1]               $lvm_lv_size             = lookup('profile::openstack::base::cinder::backup::lvm::lv_size'),
    String[1]               $lvm_lv_format           = lookup('profile::openstack::base::cinder::backup::lvm::lv_format'),
    String[1]               $user                    = lookup('profile::openstack::base::cinder::backup::user'),
) {
    $keystone_admin_uri = "https://${keystone_fqdn}:${auth_port}"

    class { "::openstack::cinder::config::${version}":
        openstack_controllers   => $openstack_controllers,
        keystone_admin_uri      => $keystone_admin_uri,
        region                  => $region,
        db_user                 => $db_user,
        db_pass                 => $db_pass,
        db_name                 => $db_name,
        db_host                 => $db_host,
        ceph_pool               => $ceph_pool,
        ceph_rbd_client_name    => $ceph_rbd_client_name,
        api_bind_port           => $api_bind_port,
        ldap_user_pass          => $ldap_user_pass,
        rabbit_user             => $rabbit_user,
        rabbit_pass             => $rabbit_pass,
        libvirt_rbd_cinder_uuid => $libvirt_rbd_cinder_uuid,
        backup_path             => $backup_path,
    }

    class { 'openstack::cinder::backup':
        version => $version,
        active  => $active,
    }

    ensure_packages(['lvm2'])

    lvm::volume { $lvm_lv_name :
        ensure => present,
        vg     => $lvm_vg_name,
        pv     => $lvm_pv_units,
        fstype => $lvm_lv_format,
        size   => $lvm_lv_size,
    }

    file { $backup_path :
        ensure => directory,
        owner  => $user,
        mode   => '0750'
    }

    mount { $backup_path :
        ensure  => mounted,
        device  => "/dev/${lvm_vg_name}/${lvm_lv_name}",
        fstype  => $lvm_lv_format,
        options => 'defaults',
        atboot  => true,
        require => [Lvm::Volume[$lvm_lv_name], File[$backup_path]],
    }
}