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
|
# File 'manifests/replicaprepare.pp', line 1
define ipa::replicaprepare (
$host = $name,
$dspw = {}
) {
Cron["k5start_root"] -> Exec["replicaprepare-${host}"] ~> Exec["replica-info-scp-${host}"] ~> Ipa::Hostdelete[$host]
$file = "/var/lib/ipa/replica-info-${host}.gpg"
realize Cron["k5start_root"]
$replicapreparecmd = shellquote('/usr/sbin/ipa-replica-prepare',"--password=${dspw}")
$replicamanagecmd = shellquote('/usr/sbin/ipa-replica-manage',"--password=${dspw}")
exec { "replicaprepare-${host}":
command => "$replicapreparecmd ${host}",
unless => "$replicamanagecmd list | /bin/grep ${host} >/dev/null 2>&1",
timeout => '0'
}
exec { "replica-info-scp-${host}":
command => shellquote('/usr/bin/scp','-q','-o','StrictHostKeyChecking=no','-o','GSSAPIAuthentication=yes','-o','ConnectTimeout=5','-o','ServerAliveInterval=2',"${file}","root@${host}:${file}"),
refreshonly => true,
tries => '60',
try_sleep => '60'
}
ipa::hostdelete { $host:
}
}
|