1 From 99a0bcc818ed801f6cb9e07a9904ee40e624bdab Mon Sep 17 00:00:00 2001
2 From: Tim Rozet <trozet@redhat.com>
3 Date: Mon, 5 Mar 2018 17:03:00 -0500
4 Subject: [PATCH] Fixes ceph key import failures by adding multiple attempts
6 Signed-off-by: Tim Rozet <trozet@redhat.com>
8 manifests/key.pp | 42 +++++++++++++++++-------------------------
9 1 file changed, 17 insertions(+), 25 deletions(-)
11 diff --git a/manifests/key.pp b/manifests/key.pp
12 index 911df1a..d47a4c3 100644
13 --- a/manifests/key.pp
14 +++ b/manifests/key.pp
15 @@ -123,22 +123,6 @@ define ceph::key (
19 - # ceph-authtool --add-key is idempotent, will just update pre-existing keys
20 - exec { "ceph-key-${name}":
21 - command => "/bin/true # comment to satisfy puppet syntax requirements
23 -ceph-authtool ${keyring_path} --name '${name}' --add-key '${secret}' ${caps}",
24 - unless => "/bin/true # comment to satisfy puppet syntax requirements
26 -NEW_KEYRING=\$(mktemp)
27 -ceph-authtool \$NEW_KEYRING --name '${name}' --add-key '${secret}' ${caps}
28 -diff -N \$NEW_KEYRING ${keyring_path}
32 - require => [ File[$keyring_path], ],
38 @@ -162,18 +146,26 @@ exit \$rv",
39 exec { "ceph-injectkey-${name}":
40 command => "/bin/true # comment to satisfy puppet syntax requirements
43 +ceph-authtool ${keyring_path} --name '${name}' --add-key '${secret}' ${caps}
45 ceph ${cluster_option} ${inject_id_option} ${inject_keyring_option} auth import -i ${keyring_path}",
46 - unless => "/bin/true # comment to satisfy puppet syntax requirements
48 -OLD_KEYRING=\$(mktemp)
49 -ceph ${cluster_option} ${inject_id_option} ${inject_keyring_option} auth get ${name} -o \$OLD_KEYRING || true
50 -diff -N \$OLD_KEYRING ${keyring_path}
54 - require => [ Class['ceph'], Exec["ceph-key-${name}"], ],
55 + require => [ File[$keyring_path], Class['ceph'] ],
63 + # ceph-authtool --add-key is idempotent, will just update pre-existing keys
64 + exec { "ceph-key-${name}":
65 + command => "/bin/true # comment to satisfy puppet syntax requirements
67 +ceph-authtool ${keyring_path} --name '${name}' --add-key '${secret}' ${caps}
68 +cat ${keyring_path}",
69 + require => [ File[$keyring_path], ],