Forgot backuppc's init.pp from last commit.
This commit is contained in:
parent
2cbd509021
commit
2f90909d9d
1 changed files with 39 additions and 32 deletions
|
@ -41,16 +41,7 @@ class backuppc::client {
|
|||
operatingsystem => "${operatingsystem}",
|
||||
}
|
||||
|
||||
if $backuppc_sshkey {
|
||||
ssh_authorized_key { "backuppc":
|
||||
ensure => present,
|
||||
key => "${backuppc_sshkey}",
|
||||
type => "ssh-rsa",
|
||||
user => root,
|
||||
target => "/root/.ssh/authorized_keys",
|
||||
tag => "backuppc",
|
||||
}
|
||||
}
|
||||
Ssh_authorized_key <<| tag == "backuppc" |>>
|
||||
|
||||
}
|
||||
|
||||
|
@ -58,37 +49,34 @@ class backuppc::client {
|
|||
#
|
||||
class backuppc::server {
|
||||
|
||||
include user::system
|
||||
realize(User["backuppc"], Group["backuppc"])
|
||||
|
||||
package { "BackupPC":
|
||||
ensure => installed,
|
||||
ensure => installed,
|
||||
require => [ User["backuppc"],
|
||||
Group["backuppc"], ],
|
||||
}
|
||||
|
||||
file { [ "/export/backuppc",
|
||||
"/export/backuppc/cpool",
|
||||
"/export/backuppc/pc",
|
||||
"/export/backuppc/pool",
|
||||
"/export/backuppc/trash", ]:
|
||||
ensure => directory,
|
||||
mode => 0750,
|
||||
owner => backuppc,
|
||||
group => root,
|
||||
require => Package["BackupPC"],
|
||||
apache::configfile { "BackupPC.conf":
|
||||
http => false,
|
||||
content => template("backuppc/BackupPC.conf.erb"),
|
||||
require => Package["BackupPC"],
|
||||
}
|
||||
file { "/srv/backuppc":
|
||||
ensure => "/export/backuppc",
|
||||
require => File["/export/backuppc"],
|
||||
}
|
||||
file { "/var/lib/BackupPC":
|
||||
ensure => "/srv/backuppc",
|
||||
force => true,
|
||||
require => File["/srv/backuppc"],
|
||||
file { "/usr/share/BackupPC/sbin/BackupPC_Admin":
|
||||
ensure => present,
|
||||
mode => 4750,
|
||||
owner => "backuppc",
|
||||
group => "httpsd",
|
||||
require => Package["BackupPC"],
|
||||
}
|
||||
|
||||
file { "/etc/BackupPC/config.pl":
|
||||
ensure => present,
|
||||
source => "puppet:///files/backuppc/config.pl",
|
||||
mode => 0640,
|
||||
owner => root,
|
||||
group => backuppc,
|
||||
mode => 0440,
|
||||
owner => "backuppc",
|
||||
group => "backuppc",
|
||||
require => Package["BackupPC"],
|
||||
notify => Service["backuppc"],
|
||||
}
|
||||
|
@ -129,4 +117,23 @@ class backuppc::server {
|
|||
require => Package["BackupPC"],
|
||||
}
|
||||
|
||||
exec { "generate-backuppc-sshkey":
|
||||
command => "ssh-keygen -q -t rsa -f /var/lib/BackupPC/.ssh/id_rsa",
|
||||
path => "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin",
|
||||
user => "backuppc",
|
||||
require => [ User["backuppc"],
|
||||
Package["BackupPC"], ],
|
||||
creates => [ "/var/lib/BackupPC/.ssh/id_rsa",
|
||||
"/var/lib/BackupPC/.ssh/id_rsa.pub", ],
|
||||
}
|
||||
|
||||
@@ssh_authorized_key { "backuppc":
|
||||
ensure => present,
|
||||
key => $backuppc_sshkey,
|
||||
type => "ssh-rsa",
|
||||
user => "root",
|
||||
target => "/root/.ssh/authorized_keys",
|
||||
tag => "backuppc",
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue