Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
2cc60956
Commit
2cc60956
authored
May 17, 2016
by
Feanil Patel
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3044 from edx/feanil/backup_restore
Fixes needed to make backups and splunk work in gocd.
parents
0f312073
a078d495
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
14 deletions
+13
-14
playbooks/roles/go-server/defaults/main.yml
+3
-3
playbooks/roles/go-server/tasks/main.yml
+2
-2
playbooks/roles/go-server/templates/gocd_backup.j2
+2
-3
playbooks/roles/splunkforwarder/tasks/main.yml
+6
-6
No files found.
playbooks/roles/go-server/defaults/main.yml
View file @
2cc60956
...
...
@@ -64,7 +64,7 @@ GO_SERVER_H2DB_BACKUP_PATH: "artifacts/db_backup/"
GO_SERVER_H2DB_BACKUP_LOCATION
:
"
{{
GO_SERVER_HOME
}}/{{
GO_SERVER_H2DB_BACKUP_PATH
}}/{{
GO_SERVER_H2DB_NAME
}}"
# For use in backup/restore of a GoCD configuration.
GO_SERVER_BACKUP_ENVIRONMENT
:
"
sandbox
"
GO_SERVER_BACKUP_ENVIRONMENT
:
"
{{
COMMON_ENVIRONMENT
}}
"
GO_SERVER_BACKUP_SNITCH_URL
:
"
https://nosnch.in/4444444444"
GO_SERVER_BACKUP_FILENAME
:
"
go-server-latest-backup.tgz"
GO_SERVER_TEMP_RESTORE_DIRECTORY
:
"
/tmp/go-server-backup"
...
...
@@ -77,10 +77,10 @@ GO_SERVER_BACKUP_TMP_LOCATION: "/tmp/{{ GO_SERVER_BACKUP_FILENAME }}"
GO_SERVER_BACKUP_CRON_SCRIPT_LOCATION
:
"
/root/gocd_backup.sh"
# When "true", attempts to restore go-server backup from S3.
GO_SERVER_RESTORE_BACKUP
:
"
false"
GO_SERVER_RESTORE_BACKUP
:
false
# When "true", attempts to configure regular, cron-based backups to S3 on go-server.
GO_SERVER_CONFIGURE_BACKUPS
:
"
false"
GO_SERVER_CONFIGURE_BACKUPS
:
false
# password file setup
GO_SERVER_PASSWORD_FILE_NAME
:
"
password.txt"
...
...
playbooks/roles/go-server/tasks/main.yml
View file @
2cc60956
...
...
@@ -104,7 +104,7 @@
force
:
no
-
include
:
download_backup.yml
when
:
GO_SERVER_BACKUP_S3_BUCKET and GO_SERVER_BACKUP_S3_OBJECT and GO_SERVER_RESTORE_BACKUP
== "true"
when
:
GO_SERVER_BACKUP_S3_BUCKET and GO_SERVER_BACKUP_S3_OBJECT and GO_SERVER_RESTORE_BACKUP
-
name
:
replace the admin line in the password file post-restore
lineinfile
:
...
...
@@ -126,4 +126,4 @@
state
:
restarted
-
include
:
setup_regular_backup.yml
when
:
GO_SERVER_BACKUP_S3_BUCKET and GO_SERVER_BACKUP_S3_OBJECT and GO_SERVER_CONFIGURE_BACKUPS
== "true"
when
:
GO_SERVER_BACKUP_S3_BUCKET and GO_SERVER_BACKUP_S3_OBJECT and GO_SERVER_CONFIGURE_BACKUPS
playbooks/roles/go-server/templates/gocd_backup.j2
View file @
2cc60956
...
...
@@ -7,7 +7,7 @@ gocd_password="{{ GO_SERVER_BACKUP_PASSWORD }}"
gocd_backup_location
=
"{{ GO_SERVER_BACKUP_TMP_LOCATION }}"
s3_backup_bucket
=
"{{ GO_SERVER_BACKUP_S3_BUCKET }}"
snitch_url
=
"{{ GO_SERVER_BACKUP_SNITCH_URL }}"
gocd_backup_base
=
gocd-
"
{{ GO_SERVER_BACKUP_ENVIRONMENT }}"
gocd_backup_base
=
"gocd-
{{ GO_SERVER_BACKUP_ENVIRONMENT }}"
# Trigger the backup and capture the backup path.
# The output of the api call is documented here:
...
...
@@ -86,4 +86,4 @@ case $aws_output in
esac
# Remove the tarball.
rm
-f
"
$gocd_backup_location
"
\ No newline at end of file
rm
-f
"
$gocd_backup_location
"
playbooks/roles/splunkforwarder/tasks/main.yml
View file @
2cc60956
...
...
@@ -67,6 +67,12 @@
when
:
download_deb.changed
notify
:
restart splunkforwarder
# Ensure permissions on splunk content
-
name
:
ensure splunk forder permissions
file
:
path={{ splunkforwarder_output_dir }} state=directory recurse=yes owner=splunk group=splunk
when
:
download_deb.changed
notify
:
restart splunkforwarder
# Update credentials
-
name
:
update admin pasword
shell
:
"
{{
splunkforwarder_output_dir
}}/bin/splunk
edit
user
admin
-password
{{
SPLUNKFORWARDER_PASSWORD
}}
-auth
admin:changeme
--accept-license
--answer-yes
--no-prompt"
...
...
@@ -78,12 +84,6 @@
when
:
download_deb.changed and create_boot_script.changed
notify
:
restart splunkforwarder
# Ensure permissions on splunk content
-
name
:
ensure splunk forder permissions
file
:
path={{ splunkforwarder_output_dir }} state=directory recurse=yes owner=splunk group=splunk
when
:
download_deb.changed
notify
:
restart splunkforwarder
# Drop template files.
-
name
:
drop input configuration
template
:
...
...
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