Puppet Class: openstack::profile::swift::storage

Defined in:
manifests/profile/swift/storage.pp

Overview

The profile for installing a single loopback storage node

Parameters:

  • zone (Any) (defaults to: undef)


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
# File 'manifests/profile/swift/storage.pp', line 2

class openstack::profile::swift::storage (
  $zone = undef,
) {
  $management_network = hiera('openstack::network::management')
  $management_address = ip_for_network($management_network)

  firewall { '6000 - Swift Object Store':
    proto  => 'tcp',
    state  => ['NEW'],
    action => 'accept',
    port   => '',
  }

  firewall { '6001 - Swift Container Store':
    proto  => 'tcp',
    state  => ['NEW'],
    action => 'accept',
    port   => '6001',
  }

  firewall { '6002 - Swift Account Store':
    proto  => 'tcp',
    state  => ['NEW'],
    action => 'accept',
    port   => '6002',
  }

  class { '::swift':
    swift_hash_suffix => hiera('openstack::swift::hash_suffix'),
  }

  swift::storage::loopback { '1':
    base_dir     => '/srv/swift-loopback',
    mnt_base_dir => '/srv/node',
    byte_size    => 1024,
    seek         => 10000,
    fstype       => 'ext4',
    require      => Class['swift'],
  }

  class { '::swift::storage::all':
    storage_local_net_ip => $management_address
  }

  @@ring_object_device { "${management_address}:6000/1":
    zone   => $zone,
    weight => 1,
  }

  @@ring_container_device { "${management_address}:6001/1":
    zone   => $zone,
    weight => 1,
  }

  @@ring_account_device { "${management_address}:6002/1":
    zone   => $zone,
    weight => 1,
  }

  swift::ringsync { ['account','container','object']: 
    ring_server => hiera('openstack::controller::address::management'), 
  }
}