File: share.pp

package info (click to toggle)
puppet-module-manila 25.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,804 kB
  • sloc: ruby: 4,767; python: 38; makefile: 10; sh: 10
file content (144 lines) | stat: -rw-r--r-- 6,430 bytes parent folder | download
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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# == Class: manila::share
#
# === Parameters
#
# [*package_ensure*]
#   (Optional) Ensure State for package
#   Defaults to 'present'.
#
# [*enabled*]
#   (Optional) Should the service be enabled
#   Defaults to true.
#
# [*manage_service*]
#   (Optional) Whether the service should be managed by Puppet
#   Defaults to true.
#
# [*delete_share_server_with_last_share*]
#   (Optional) Wheather share servers will be deleted on deletion of the last
#   share.
#   Defaults to $facts['os_service_default'].
#
# [*unmanage_remove_access_rules*]
#   (Optional) Deny access and remove all access rules on share unmanage.
#   Defaults to $facts['os_service_default'].
#
# [*automatic_share_server_cleanup*]
#   (Optional) Delete all share servers which were unused more than specified
#   time.
#   Defaults to $facts['os_service_default'].
#
# [*unused_share_server_cleanup_interval*]
#   (Optional) Unallocated share servers reclamation time interval (minutes).
#   Defaults to $facts['os_service_default'].
#
# [*replica_state_update_interval*]
#   (Optional) Interval to poll for the health of each replica instance.
#   Defaults to $facts['os_service_default'].
#
# [*migration_driver_continue_update_interval*]
#   (Optional) Interval to poll the driver to perform the next step of
#   migration in the storage backend, for a migration share.
#   Defaults to $facts['os_service_default'].
#
# [*server_migration_driver_continue_update_interval*]
#   (Optional) Interval to poll the driver to perform the next step of
#   migration in the storage backend, for a migration share server.
#   Defaults to $facts['os_service_default'].
#
# [*share_usage_size_update_interval*]
#   (Optional) Interval to poll the driver to update the share usage size in
#   the storage backend.
#   Defaults to $facts['os_service_default'].
#
# [*enable_gathering_share_usage_size*]
#   (Optional) Poll share usage size. Usage data can be consumed by telemetry
#   integration.
#   Defaults to $facts['os_service_default'].
#
# [*share_service_inithost_offload*]
#   (Optional) Offload pending share ensure during share service startup.
#   Defaults to $facts['os_service_default'].
#
# [*check_for_expired_shares_in_recycle_bin_interval*]
#   (Optional) Interval to check for expired shares and delete them from
#   the Recycle bin.
#   Defaults to $facts['os_service_default'].
#
# [*check_for_expired_transfers*]
#   (Optional) Interval to check for expired transfers and destroy them and
#   roll back share state.
#   Defaults to $facts['os_service_default'].
#
# [*driver_backup_continue_update_interval*]
#   (Optional) Interval to poll to perform the next steps of backup.
#   Defaults to $facts['os_service_default'].
#
# [*driver_restore_continue_update_interval*]
#   (Optional) Interval to poll to perform the next steps of restore.
#   Defaults to $facts['os_service_default'].
#
class manila::share (
  $package_ensure                                   = 'present',
  Boolean $enabled                                  = true,
  Boolean $manage_service                           = true,
  $delete_share_server_with_last_share              = $facts['os_service_default'],
  $unmanage_remove_access_rules                     = $facts['os_service_default'],
  $automatic_share_server_cleanup                   = $facts['os_service_default'],
  $unused_share_server_cleanup_interval             = $facts['os_service_default'],
  $replica_state_update_interval                    = $facts['os_service_default'],
  $migration_driver_continue_update_interval        = $facts['os_service_default'],
  $server_migration_driver_continue_update_interval = $facts['os_service_default'],
  $share_usage_size_update_interval                 = $facts['os_service_default'],
  $enable_gathering_share_usage_size                = $facts['os_service_default'],
  $share_service_inithost_offload                   = $facts['os_service_default'],
  $check_for_expired_shares_in_recycle_bin_interval = $facts['os_service_default'],
  $check_for_expired_transfers                      = $facts['os_service_default'],
  $driver_backup_continue_update_interval           = $facts['os_service_default'],
  $driver_restore_continue_update_interval          = $facts['os_service_default'],
) {

  include manila::deps
  include manila::params

  if $::manila::params::share_package {
    package { 'manila-share':
      ensure => $package_ensure,
      name   => $::manila::params::share_package,
      tag    => ['openstack', 'manila-package'],
    }
  }

  manila_config {
    'DEFAULT/delete_share_server_with_last_share':              value => $delete_share_server_with_last_share;
    'DEFAULT/unmanage_remove_access_rules':                     value => $unmanage_remove_access_rules;
    'DEFAULT/automatic_share_server_cleanup':                   value => $automatic_share_server_cleanup;
    'DEFAULT/unused_share_server_cleanup_interval':             value => $unused_share_server_cleanup_interval;
    'DEFAULT/replica_state_update_interval':                    value => $replica_state_update_interval;
    'DEFAULT/migration_driver_continue_update_interval':        value => $migration_driver_continue_update_interval;
    'DEFAULT/server_migration_driver_continue_update_interval': value => $server_migration_driver_continue_update_interval;
    'DEFAULT/share_usage_size_update_interval':                 value => $share_usage_size_update_interval;
    'DEFAULT/enable_gathering_share_usage_size':                value => $enable_gathering_share_usage_size;
    'DEFAULT/share_service_inithost_offload':                   value => $share_service_inithost_offload;
    'DEFAULT/check_for_expired_shares_in_recycle_bin_interval': value => $check_for_expired_shares_in_recycle_bin_interval;
    'DEFAULT/check_for_expired_transfers':                      value => $check_for_expired_transfers;
    'DEFAULT/driver_backup_continue_update_interval':           value => $driver_backup_continue_update_interval;
    'DEFAULT/driver_restore_continue_update_interval':          value => $driver_restore_continue_update_interval;
  }

  if $manage_service {
    if $enabled {
      $ensure = 'running'
    } else {
      $ensure = 'stopped'
    }

    service { 'manila-share':
      ensure    => $ensure,
      name      => $::manila::params::share_service,
      enable    => $enabled,
      hasstatus => true,
      tag       => 'manila-service',
    }
  }
}