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}",
|
operatingsystem => "${operatingsystem}",
|
||||||
}
|
}
|
||||||
|
|
||||||
if $backuppc_sshkey {
|
Ssh_authorized_key <<| tag == "backuppc" |>>
|
||||||
ssh_authorized_key { "backuppc":
|
|
||||||
ensure => present,
|
|
||||||
key => "${backuppc_sshkey}",
|
|
||||||
type => "ssh-rsa",
|
|
||||||
user => root,
|
|
||||||
target => "/root/.ssh/authorized_keys",
|
|
||||||
tag => "backuppc",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,37 +49,34 @@ class backuppc::client {
|
||||||
#
|
#
|
||||||
class backuppc::server {
|
class backuppc::server {
|
||||||
|
|
||||||
|
include user::system
|
||||||
|
realize(User["backuppc"], Group["backuppc"])
|
||||||
|
|
||||||
package { "BackupPC":
|
package { "BackupPC":
|
||||||
ensure => installed,
|
ensure => installed,
|
||||||
|
require => [ User["backuppc"],
|
||||||
|
Group["backuppc"], ],
|
||||||
}
|
}
|
||||||
|
|
||||||
file { [ "/export/backuppc",
|
apache::configfile { "BackupPC.conf":
|
||||||
"/export/backuppc/cpool",
|
http => false,
|
||||||
"/export/backuppc/pc",
|
content => template("backuppc/BackupPC.conf.erb"),
|
||||||
"/export/backuppc/pool",
|
require => Package["BackupPC"],
|
||||||
"/export/backuppc/trash", ]:
|
|
||||||
ensure => directory,
|
|
||||||
mode => 0750,
|
|
||||||
owner => backuppc,
|
|
||||||
group => root,
|
|
||||||
require => Package["BackupPC"],
|
|
||||||
}
|
}
|
||||||
file { "/srv/backuppc":
|
file { "/usr/share/BackupPC/sbin/BackupPC_Admin":
|
||||||
ensure => "/export/backuppc",
|
ensure => present,
|
||||||
require => File["/export/backuppc"],
|
mode => 4750,
|
||||||
}
|
owner => "backuppc",
|
||||||
file { "/var/lib/BackupPC":
|
group => "httpsd",
|
||||||
ensure => "/srv/backuppc",
|
require => Package["BackupPC"],
|
||||||
force => true,
|
|
||||||
require => File["/srv/backuppc"],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "/etc/BackupPC/config.pl":
|
file { "/etc/BackupPC/config.pl":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
source => "puppet:///files/backuppc/config.pl",
|
source => "puppet:///files/backuppc/config.pl",
|
||||||
mode => 0640,
|
mode => 0440,
|
||||||
owner => root,
|
owner => "backuppc",
|
||||||
group => backuppc,
|
group => "backuppc",
|
||||||
require => Package["BackupPC"],
|
require => Package["BackupPC"],
|
||||||
notify => Service["backuppc"],
|
notify => Service["backuppc"],
|
||||||
}
|
}
|
||||||
|
@ -129,4 +117,23 @@ class backuppc::server {
|
||||||
require => Package["BackupPC"],
|
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