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
8 years ago
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
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
12 deletions
+12
-12
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
+1
-1
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/"
...
@@ -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
}}"
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.
# 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_SNITCH_URL
:
"
https://nosnch.in/4444444444"
GO_SERVER_BACKUP_FILENAME
:
"
go-server-latest-backup.tgz"
GO_SERVER_BACKUP_FILENAME
:
"
go-server-latest-backup.tgz"
GO_SERVER_TEMP_RESTORE_DIRECTORY
:
"
/tmp/go-server-backup"
GO_SERVER_TEMP_RESTORE_DIRECTORY
:
"
/tmp/go-server-backup"
...
@@ -77,10 +77,10 @@ GO_SERVER_BACKUP_TMP_LOCATION: "/tmp/{{ GO_SERVER_BACKUP_FILENAME }}"
...
@@ -77,10 +77,10 @@ GO_SERVER_BACKUP_TMP_LOCATION: "/tmp/{{ GO_SERVER_BACKUP_FILENAME }}"
GO_SERVER_BACKUP_CRON_SCRIPT_LOCATION
:
"
/root/gocd_backup.sh"
GO_SERVER_BACKUP_CRON_SCRIPT_LOCATION
:
"
/root/gocd_backup.sh"
# When "true", attempts to restore go-server backup from S3.
# 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.
# 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
# password file setup
GO_SERVER_PASSWORD_FILE_NAME
:
"
password.txt"
GO_SERVER_PASSWORD_FILE_NAME
:
"
password.txt"
...
...
This diff is collapsed.
Click to expand it.
playbooks/roles/go-server/tasks/main.yml
View file @
2cc60956
...
@@ -104,7 +104,7 @@
...
@@ -104,7 +104,7 @@
force
:
no
force
:
no
-
include
:
download_backup.yml
-
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
-
name
:
replace the admin line in the password file post-restore
lineinfile
:
lineinfile
:
...
@@ -126,4 +126,4 @@
...
@@ -126,4 +126,4 @@
state
:
restarted
state
:
restarted
-
include
:
setup_regular_backup.yml
-
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
This diff is collapsed.
Click to expand it.
playbooks/roles/go-server/templates/gocd_backup.j2
View file @
2cc60956
...
@@ -7,7 +7,7 @@ gocd_password="{{ GO_SERVER_BACKUP_PASSWORD }}"
...
@@ -7,7 +7,7 @@ gocd_password="{{ GO_SERVER_BACKUP_PASSWORD }}"
gocd_backup_location
=
"{{ GO_SERVER_BACKUP_TMP_LOCATION }}"
gocd_backup_location
=
"{{ GO_SERVER_BACKUP_TMP_LOCATION }}"
s3_backup_bucket
=
"{{ GO_SERVER_BACKUP_S3_BUCKET }}"
s3_backup_bucket
=
"{{ GO_SERVER_BACKUP_S3_BUCKET }}"
snitch_url
=
"{{ GO_SERVER_BACKUP_SNITCH_URL }}"
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.
# Trigger the backup and capture the backup path.
# The output of the api call is documented here:
# The output of the api call is documented here:
...
...
This diff is collapsed.
Click to expand it.
playbooks/roles/splunkforwarder/tasks/main.yml
View file @
2cc60956
...
@@ -67,6 +67,12 @@
...
@@ -67,6 +67,12 @@
when
:
download_deb.changed
when
:
download_deb.changed
notify
:
restart splunkforwarder
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
# Update credentials
-
name
:
update admin pasword
-
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"
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 @@
...
@@ -78,12 +84,6 @@
when
:
download_deb.changed and create_boot_script.changed
when
:
download_deb.changed and create_boot_script.changed
notify
:
restart splunkforwarder
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.
# Drop template files.
-
name
:
drop input configuration
-
name
:
drop input configuration
template
:
template
:
...
...
This diff is collapsed.
Click to expand it.
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