Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
su_ldap
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
suitpuppet
su_ldap
Commits
971bf8e7
Commit
971bf8e7
authored
5 years ago
by
Srinivas Rao Puttagunta
Browse files
Options
Downloads
Patches
Plain Diff
Working on Missing newsyslog
parent
6b199b44
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
files/etc/newsyslog/master
+11
-0
11 additions, 0 deletions
files/etc/newsyslog/master
manifests/backups.pp
+22
-9
22 additions, 9 deletions
manifests/backups.pp
templates/etc/newsyslog/master.erb
+34
-0
34 additions, 0 deletions
templates/etc/newsyslog/master.erb
with
67 additions
and
9 deletions
files/etc/newsyslog/master
0 → 100644
+
11
−
0
View file @
971bf8e7
# master -- Backup an LDAP server database
#
set logdir = /var/log/%n
set save = /var/log/OLD/%n
dbarchive {
stop: run /usr/sbin/ldap-backup
log: db-ldif logdir root 0 644
archive: db-ldif save 30
This diff is collapsed.
Click to expand it.
manifests/backups.pp
+
22
−
9
View file @
971bf8e7
...
...
@@ -20,6 +20,28 @@ class su_ldap::backups(
$master_name
=
"ldap/ldap-
${env}
master.stanford.edu"
}
# cron jobs we care about
file
{
'/etc/cron.d/master-audit'
:
mode
=>
'0644'
,
source
=>
'puppet:///modules/su_ldap/etc/cron.d/master-audit'
;
'/etc/cron.d/master-restart'
:
mode
=>
'0644'
,
content
=>
template
(
'su_ldap/etc/cron.d/master-restart.erb'
);
}
# We want a newsyslog task to rotate the LDAP _data_ (as opposed to the
# LDAP logs) into a local directory. If this is the production master,
# we want to rotate the data into AFS as well.
#
$save_to_afs
=
true
file
{
'/etc/newsyslog/master'
:
ensure
=>
file
,
mode
=>
'0644'
,
content
=>
template
(
'su_ldap/etc/newsyslog/master.erb'
),
require
=>
File
[
'/etc/newsyslog'
],
}
## Directory where we put GCP credentials
file
{
'/etc/ldapadmin'
:
ensure
=>
directory
;
...
...
@@ -78,14 +100,5 @@ class su_ldap::backups(
}
}
# cron jobs we care about
file
{
'/etc/cron.d/master-audit'
:
mode
=>
'0644'
,
source
=>
'puppet:///modules/su_ldap/etc/cron.d/master-audit'
;
'/etc/cron.d/master-restart'
:
mode
=>
'0644'
,
content
=>
template
(
's_ldap/etc/cron.d/master-restart.erb'
);
}
}
This diff is collapsed.
Click to expand it.
templates/etc/newsyslog/master.erb
0 → 100644
+
34
−
0
View file @
971bf8e7
# master -- Rotate production master backup into AFS.
#
# This newsyslog configuration file rotates the LDAP database into
# the local log directory as well as into AFS.
#
# Look for the file /var/log/db-ldif:
#
# 1. Make a compressed copy of /var/log/db-ldif and put this compressed
# copy into /var/log/OLD/ rotating the older versions. Allow up to 30
# such compressed copies.
#
# 2. Make a compressed copy of /var/log/db-ldif and put this compressed
# copy into
# /afs/ir/service/directory/data/backups/%Y/%M/%d/%m.%n. Recall that %Y
# is the year number, %M is the month number, %d is the day number, %m
# the server name, and %n is 'db-ldif'.
# Example:
# /afs/ir/service/directory/data/backups/2015/11/2015-11-01/directory-master0.db-ldif.gz
set logfile = /var/log/%n
set save = /var/lib/ldap/logs/OLD/%n
<%
if
(
@save_to_afs
)
then
-%>
set archive = /afs/ir/service/directory/data/backups/%Y/%M/%d/%m.%n
<%
end
-%>
dbarchive {
stop: run /usr/sbin/ldap-backup
log: db-ldif logfile root 0 644
archive: db-ldif save 30
<%
if
(
@save_to_afs
)
then
-%>
archive: db-ldif archive 0
<%
end
-%>
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment