7580845e03f3f883a33cd8ef24127966cbb3610e
[mirror/dsa-puppet.git] / modules / postgres / manifests / backup_server / register_backup_clienthost.pp
1 # register this host at the backup servers
2 #
3 # This class set up the ssh authorization on the backup servers
4 # so this client can push WAL segments.
5 define postgres::backup_server::register_backup_clienthost (
6 ) {
7   include postgres::backup_server::globals
8
9   $ssh_command = "/usr/local/bin/debbackup-ssh-wrap ${::hostname}"
10
11   ssh::authorized_key_add { 'register_backup_clienthost':
12     target_user => $postgres::backup_server::globals::backup_unix_user,
13     key         => dig($facts, 'ssh_keys_users', 'postgres', 'id_rsa.pub', 'line'),
14     command     => $ssh_command,
15     from        => $base::public_addresses,
16     collect_tag => $postgres::backup_server::globals::tag_source_sshkey,
17   }
18 }