Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
puppet-backupninja
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chris
puppet-backupninja
Commits
bee234d0
Commit
bee234d0
authored
Aug 16, 2010
by
Silvio Rhatto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial code for rsync handler
parent
7f3356e3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
140 additions
and
0 deletions
+140
-0
manifests/client.pp
manifests/client.pp
+10
-0
manifests/rsync.pp
manifests/rsync.pp
+86
-0
templates/rsync.conf.erb
templates/rsync.conf.erb
+44
-0
No files found.
manifests/client.pp
View file @
bee234d0
...
...
@@ -151,3 +151,13 @@ class backupninja::client::sys inherits backupninja::client::defaults {
default
:
{}
}
}
class
backupninja::client::rsync
inherits
backupninja::client::defaults
{
if
!
defined
(
Package
[
"rsync"
])
{
if
$rsync_ensure_version
==
''
{
$rsync_ensure_version
=
'installed'
}
package
{
'rsync'
:
ensure
=>
$rsync_ensure_version
,
}
}
}
manifests/rsync.pp
0 → 100644
View file @
bee234d0
# Run rsync as part of a backupninja run.
# Based on backupninja::rdiff
define
backupninja::rsync
(
$order
=
90
,
$ensure
=
present
,
$user
=
false
,
$home
=
false
,
$host
=
false
,
$ssh_dir_manage
=
true
,
$ssh_dir
=
false
,
$authorized_keys_file
=
false
$installuser
=
true
,
$installkey
=
true
,
$key
=
false
,
$backuptag
=
false
$home
=
false
,
$backupkeytype
=
"rsa"
,
$backupkeystore
=
false
,
$extras
=
false
,
$nagios2_description
=
'backups'
,
$subfolder
=
'rsync'
,
$rm
=
false
,
$cp
=
false
,
$touch
=
false
,
$mv
=
false
,
$fsck
=
false
,
$log
=
false
,
$partition
=
false
,
$fscheck
=
false
,
$read_only
=
false
,
$mountpoint
=
false
,
$backupdir
=
false
,
$format
=
false
,
$days
=
'5'
,
$keepdaily
=
false
,
$keepweekly
=
false
,
$keepmonthly
=
false
,
$lockfile
=
false
,
$nicelevel
=
0
,
$enable_mv_timestamp_bug
=
false
,
$tmp
=
false
,
$multiconnection
=
false
,
$from
=
'local'
,
$rsync
=
false
,
$rsync_options
=
false
,
$testconnect
=
false
,
$protocol
=
false
,
$ssh
=
false
,
$port
=
false
,
$bandwidthlimit
=
false
,
$remote_rsync
=
false
,
$id_file
=
false
,
$batch
=
false
,
$filelist
=
false
,
$filelistbase
=
false
,
$exclude
=
[
"/home/*/.gnupg"
,
"/home/*/.local/share/Trash"
,
"/home/*/.Trash"
,
"/home/*/.thumbnails"
,
"/home/*/.beagle"
,
"/home/*/.aMule"
,
"/home/*/gtk-gnutella-downloads"
],
$include
=
[
"/var/spool/cron/crontabs"
,
"/var/backups"
,
"/etc"
,
"/root"
,
"/home"
,
"/usr/local/*bin"
,
"/var/lib/dpkg/status*"
],
$exclude_vserver
=
false
,
$numericids
=
false
,
$compress
=
false
,
$dest
=
false
,
$fakesuper
=
false
,
$batchname
=
false
,
$initscripts
=
false
,
$service
=
false
)
{
include
backupninja::client::rsync
case
$dest
{
'remote'
:
{
case
$host
{
false
:
{
err
(
"need to define a host for remote backups!"
)
}
}
$real_backuptag
=
$backuptag
?
{
false
=>
"backupninja-
$fqdn
"
,
default
=>
$backuptag
}
$real_home
=
$home
?
{
false
=>
"/home/
${user}
-
${name}
"
,
default
=>
$home
,
}
$directory
=
"
${real_home}
/
${subfolder}
/"
backupninja::server::sandbox
{
"
${user}
-
${name}
"
:
user
=>
$user
,
host
=>
$host
,
dir
=>
$real_home
,
manage_ssh_dir
=>
$ssh_dir_manage
,
ssh_dir
=>
$ssh_dir
,
key
=>
$key
,
authorized_keys_file
=>
$authorized_keys_file
,
installuser
=>
$installuser
,
backuptag
=>
$real_backuptag
,
keytype
=>
$backupkeytype
,
backupkeys
=>
$backupkeystore
,
nagios2_description
=>
$nagios2_description
}
backupninja::client::key
{
"
${user}
-
${name}
"
:
user
=>
$user
,
host
=>
$host
,
installkey
=>
$installkey
,
keytype
=>
$backupkeytype
,
keystore
=>
$backupkeystore
,
}
}
}
file
{
"
${backupninja::client::defaults::configdir}
/
${order}
_
${name}
.rsync"
:
ensure
=>
$ensure
,
content
=>
template
(
'backupninja/rsync.conf.erb'
),
owner
=>
root
,
group
=>
root
,
mode
=>
0600
,
require
=>
File
[
"
${backupninja::client::defaults::configdir}
"
]
}
}
templates/rsync.conf.erb
0 → 100644
View file @
bee234d0
# This configuration file was auto-generated by the Puppet configuration
# management system. Any changes you make to this file will be overwritten
# the next time Puppet runs. Please make configuration changes to this
# service in Puppet.
[general]
<%-
%w{log partition fscheck read_only mountpoint backupdir format days keepdaily keepweekly keepmonthly lockfile nicelevel enable_mv_timestamp_bug, tmp, multiconnection}
.
each
do
|
v
|
if
has_variable?
(
v
)
and
instance_variable_get
(
"@
#{
v
}
"
).
to_s
!=
"false"
-%>
<%=
v
+
' = '
+
instance_variable_get
(
"@
#{
v
}
"
).
to_s
%>
<%-
end
end
-%>
[source]
<%-
%w{from host port user testconnect include exclude ssh protocol rsync rssync_options exclude_vserver, numericids, compress, bandwidthlimit, remote_rsync, id_file, batch, batchbase, filelist, filelistbase}
.
each
do
|
v
|
if
has_variable?
(
v
)
and
instance_variable_get
(
"@
#{
v
}
"
).
to_s
!=
"false"
-%>
<%=
v
+
' = '
+
instance_variable_get
(
"@
#{
v
}
"
).
to_s
%>
<%-
end
end
-%>
[dest]
<%-
%w{dest, testconnect, ssh, protocol, numericids, compress, host, port, user, id_file, bandwidthlimit, remote_rsync, batch, batchbase, fakesuper}
.
each
do
|
v
|
if
has_variable?
(
v
)
and
instance_variable_get
(
"@
#{
v
}
"
).
to_s
!=
"false"
-%>
<%=
v
+
' = '
+
instance_variable_get
(
"@
#{
v
}
"
).
to_s
%>
<%-
end
end
-%>
[services]
<%-
%w{initscripts, service}
.
each
do
|
v
|
if
has_variable?
(
v
)
and
instance_variable_get
(
"@
#{
v
}
"
).
to_s
!=
"false"
-%>
<%=
v
+
' = '
+
instance_variable_get
(
"@
#{
v
}
"
).
to_s
%>
<%-
end
end
-%>
[system]
<%-
%w{rm, cp, touch, mv fsck}
.
each
do
|
v
|
if
has_variable?
(
v
)
and
instance_variable_get
(
"@
#{
v
}
"
).
to_s
!=
"false"
-%>
<%=
v
+
' = '
+
instance_variable_get
(
"@
#{
v
}
"
).
to_s
%>
<%-
end
end
-%>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment