Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Matevz Golob
slapos
Commits
3d378c60
Commit
3d378c60
authored
Nov 23, 2011
by
Antoine Catton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Easily switch from main MariaDB to backup one
parent
92278483
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
33 deletions
+15
-33
slapos/recipe/request.py
slapos/recipe/request.py
+9
-2
stack/lamp/buildout.cfg
stack/lamp/buildout.cfg
+2
-9
stack/lamp/instance-backuped.cfg
stack/lamp/instance-backuped.cfg
+4
-1
stack/lamp/instance-use-backup.cfg
stack/lamp/instance-use-backup.cfg
+0
-20
stack/lamp/instance.cfg
stack/lamp/instance.cfg
+0
-1
No files found.
slapos/recipe/request.py
View file @
3d378c60
...
@@ -75,9 +75,16 @@ class Recipe(object):
...
@@ -75,9 +75,16 @@ class Recipe(object):
partition_parameter_kw
[
config_parameter
]
=
\
partition_parameter_kw
[
config_parameter
]
=
\
options
[
'config-%s'
%
config_parameter
]
options
[
'config-%s'
%
config_parameter
]
name
=
options
[
'name'
]
if
'id'
in
options
:
id_
=
int
(
options
[
'id'
],
10
)
if
'id-increment'
in
options
:
id_
+=
int
(
options
[
'id-increment'
],
10
)
name
+=
'-%03d'
%
id_
instance
=
self
.
request
(
options
[
'software-url'
],
software_type
,
instance
=
self
.
request
(
options
[
'software-url'
],
software_type
,
options
[
'name'
]
,
partition_parameter_kw
=
partition_parameter_kw
,
name
,
partition_parameter_kw
=
partition_parameter_kw
,
filter_kw
=
filter_kw
,
shared
=
self
.
isSlave
)
filter_kw
=
filter_kw
,
shared
=
self
.
isSlave
)
self
.
failed
=
None
self
.
failed
=
None
for
param
in
self
.
return_parameters
:
for
param
in
self
.
return_parameters
:
...
...
stack/lamp/buildout.cfg
View file @
3d378c60
...
@@ -76,7 +76,7 @@ strip-top-level-dir = true
...
@@ -76,7 +76,7 @@ strip-top-level-dir = true
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
url = ${:_profile_base_location_}/instance.cfg
output = ${buildout:directory}/template.cfg
output = ${buildout:directory}/template.cfg
md5sum =
d7a6e9bbde95bf8bbb3f1844aefd789a
md5sum =
f4e4cf75225685e1787c0bc6d1c16910
mode = 0644
mode = 0644
[template-apache-php]
[template-apache-php]
...
@@ -90,14 +90,7 @@ mode = 0644
...
@@ -90,14 +90,7 @@ mode = 0644
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-backuped.cfg
url = ${:_profile_base_location_}/instance-backuped.cfg
output = ${buildout:directory}/template-backuped.cfg
output = ${buildout:directory}/template-backuped.cfg
md5sum = 0fedb9ed84137b2d5518ffbaaa6d76eb
md5sum = d2d910986762b52d8ff965292d7c3635
mode = 0644
[template-use-backup]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-use-backup.cfg
output = ${buildout:directory}/template-use-backup.cfg
md5sum = e2e0fe0da5d2944feba0991b8948d04b
mode = 0644
mode = 0644
[template-mariadb]
[template-mariadb]
...
...
stack/lamp/instance-backuped.cfg
View file @
3d378c60
...
@@ -31,6 +31,7 @@ slave = false
...
@@ -31,6 +31,7 @@ slave = false
[request-mariadb]
[request-mariadb]
software-type = mariadb-pbsready-export
software-type = mariadb-pbsready-export
id = $${slap-parameter:mariadb-id}
config = authorized-key notify
config = authorized-key notify
config-authorized-key = $${request-pull-backup-server:connection-ssh-key}
config-authorized-key = $${request-pull-backup-server:connection-ssh-key}
config-notify = $${request-pull-backup-server:connection-notification-url}
config-notify = $${request-pull-backup-server:connection-notification-url}
...
@@ -39,7 +40,9 @@ return = url ssh-public-key ssh-url notification-id
...
@@ -39,7 +40,9 @@ return = url ssh-public-key ssh-url notification-id
[request-mariadb-pseudo-replicating]
[request-mariadb-pseudo-replicating]
<= slap-connection
<= slap-connection
recipe = slapos.cookbook:request
recipe = slapos.cookbook:request
name = MariaDB (backup)
name = $${request-mariadb:name}
id = $${request-mariadb:id}
id-increment = 1
software-url = $${slap-connection:software-release-url}
software-url = $${slap-connection:software-release-url}
software-type = mariadb-pbsready-import
software-type = mariadb-pbsready-import
return = url ssh-public-key ssh-url notification-url
return = url ssh-public-key ssh-url notification-url
...
...
stack/lamp/instance-use-backup.cfg
deleted
100644 → 0
View file @
92278483
[buildout]
extends =
${template-backuped:output}
[mariadb-urlparse]
recipe = slapos.cookbook:urlparse
url = $${request-mariadb-pseudo-replicating:connection-url}
[request-mariadb]
software-type = mariadb-pbsready-import
[request-mariadb-pseudo-replicating]
software-type = mariadb-pbsready-export
[request-pull-backup-server-mariadb]
config-type = push
[request-pull-backup-server-mariadb-backup]
config-type = pull
stack/lamp/instance.cfg
View file @
3d378c60
...
@@ -10,7 +10,6 @@ offline = true
...
@@ -10,7 +10,6 @@ offline = true
recipe = slapos.cookbook:softwaretype
recipe = slapos.cookbook:softwaretype
default = ${template-apache-php:output}
default = ${template-apache-php:output}
backuped = ${template-backuped:output}
backuped = ${template-backuped:output}
use-backup = ${template-use-backup:output}
mariadb = ${template-mariadb:output}
mariadb = ${template-mariadb:output}
mariadb-pbsready-import = ${template-mariadb-pbsready-import:output}
mariadb-pbsready-import = ${template-mariadb-pbsready-import:output}
mariadb-pbsready-export = ${template-mariadb-pbsready-export:output}
mariadb-pbsready-export = ${template-mariadb-pbsready-export:output}
...
...
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