Merge "Added default timeout for exec resources"
This commit is contained in:
commit
d387b0725f
4 files changed
+24
No files matched your search
@@ -51,6 +51,9 @@
|
||||
# [*keyring*] Path of the [mon.] keyring file
|
||||
# Optional. $key and $keyring are mutually exclusive.
|
||||
#
|
||||
# [*exec_timeout*] The default exec resource timeout, in seconds
|
||||
# Optional. Defaults to $::ceph::params::exec_timeout
|
||||
#
|
||||
define ceph::mon (
|
||||
$ensure = present,
|
||||
$public_addr = undef,
|
||||
@@ -58,6 +61,7 @@ define ceph::mon (
|
||||
$authentication_type = 'cephx',
|
||||
$key = undef,
|
||||
$keyring = undef,
|
||||
$exec_timeout = $::ceph::params::exec_timeout,
|
||||
) {
|
||||
|
||||
# a puppet name translates into a ceph id, the meaning is different
|
||||
@@ -161,6 +165,7 @@ mon_data=\$(ceph-mon ${cluster_option} --id ${id} --show-config-value mon_data)
|
||||
test -d \$mon_data
|
||||
",
|
||||
logoutput => true,
|
||||
timeout => $exec_timeout,
|
||||
}
|
||||
->
|
||||
service { $mon_service:
|
||||
@@ -199,6 +204,7 @@ mon_data=\$(ceph-mon ${cluster_option} --id ${id} --show-config-value mon_data)
|
||||
test ! -d \$mon_data
|
||||
",
|
||||
logoutput => true,
|
||||
timeout => $exec_timeout,
|
||||
} -> Package<| tag == 'ceph' |>
|
||||
}
|
||||
}
|
||||
@@ -38,10 +38,14 @@
|
||||
# [*cluster*] The ceph cluster
|
||||
# Optional. Same default as ceph.
|
||||
#
|
||||
# [*exec_timeout*] The default exec resource timeout, in seconds
|
||||
# Optional. Defaults to $::ceph::params::exec_timeout
|
||||
#
|
||||
define ceph::osd (
|
||||
$ensure = present,
|
||||
$journal = undef,
|
||||
$cluster = undef,
|
||||
$exec_timeout = $::ceph::params::exec_timeout,
|
||||
) {
|
||||
|
||||
$data = $name
|
||||
@@ -76,6 +80,7 @@ ceph-disk list | grep -E ' *${data}1? .*ceph data, (prepared|active)' ||
|
||||
ls -l /var/lib/ceph/osd/${cluster_name}-* | grep ' ${data}\$'
|
||||
",
|
||||
logoutput => true,
|
||||
timeout => $exec_timeout,
|
||||
}
|
||||
|
||||
Exec[$ceph_prepare] -> Exec[$ceph_activate]
|
||||
@@ -135,6 +140,7 @@ else
|
||||
fi
|
||||
",
|
||||
logoutput => true,
|
||||
timeout => $exec_timeout,
|
||||
} -> Ceph::Mon<| ensure == absent |>
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
# should be considered to be constant
|
||||
#
|
||||
# === Parameters:
|
||||
# [*exec_timeout*] The default exec resource timeout, in seconds
|
||||
# Optional. Defaults to 600
|
||||
#
|
||||
# [*packages*] The ceph package name
|
||||
# Optional. Defaults to 'ceph'
|
||||
@@ -30,6 +32,7 @@
|
||||
# Optional. Defaults to '/tmp/radosgw.sock'
|
||||
#
|
||||
class ceph::params (
|
||||
$exec_timeout = 600,
|
||||
$packages = 'ceph', # just provide the minimum per default
|
||||
$rgw_socket_path = '/tmp/radosgw.sock',
|
||||
) {
|
||||
|
||||
@@ -43,11 +43,15 @@
|
||||
# Optional. Default is undef.
|
||||
# Increase or decrease the replica level of a pool.
|
||||
#
|
||||
# [*exec_timeout*] The default exec resource timeout, in seconds
|
||||
# Optional. Defaults to $::ceph::params::exec_timeout
|
||||
#
|
||||
define ceph::pool (
|
||||
$ensure = present,
|
||||
$pg_num = 64,
|
||||
$pgp_num = undef,
|
||||
$size = undef,
|
||||
$exec_timeout = $::ceph::params::exec_timeout,
|
||||
) {
|
||||
|
||||
if $ensure == present {
|
||||
@@ -62,6 +66,7 @@ ceph osd pool create ${name} ${pg_num}",
|
||||
unless => "/bin/true # comment to satisfy puppet syntax requirements
|
||||
set -ex
|
||||
ceph osd lspools | grep ' ${name},'",
|
||||
timeout => $exec_timeout,
|
||||
}
|
||||
|
||||
exec { "set-${name}-pg_num":
|
||||
@@ -72,6 +77,7 @@ ceph osd pool set ${name} pg_num ${pg_num}",
|
||||
set -ex
|
||||
test $(ceph osd pool get ${name} pg_num | sed 's/.*:\s*//g') -ge ${pg_num}",
|
||||
require => Exec["create-${name}"],
|
||||
timeout => $exec_timeout,
|
||||
}
|
||||
|
||||
if $pgp_num {
|
||||
@@ -83,6 +89,7 @@ ceph osd pool set ${name} pgp_num ${pgp_num}",
|
||||
set -ex
|
||||
test $(ceph osd pool get ${name} pgp_num | sed 's/.*:\s*//g') -ge ${pgp_num}",
|
||||
require => Exec["create-${name}"],
|
||||
timeout => $exec_timeout,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,6 +102,7 @@ ceph osd pool set ${name} size ${size}",
|
||||
set -ex
|
||||
test $(ceph osd pool get ${name} size | sed 's/.*:\s*//g') -eq ${size}",
|
||||
require => Exec["create-${name}"],
|
||||
timeout => $exec_timeout,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,6 +115,7 @@ ceph osd pool delete ${name} ${name} --yes-i-really-really-mean-it",
|
||||
onlyif => "/bin/true # comment to satisfy puppet syntax requirements
|
||||
set -ex
|
||||
ceph osd lspools | grep ${name}",
|
||||
timeout => $exec_timeout,
|
||||
} -> Ceph::Mon<| ensure == absent |>
|
||||
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user