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
Kasra Jamshidi
slapos
Commits
bcd98f53
Commit
bcd98f53
authored
Oct 31, 2012
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correctly assign slave instances
parent
4fe6b083
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
5 deletions
+27
-5
slapos/recipe/request.py
slapos/recipe/request.py
+12
-2
stack/lamp/buildout.cfg
stack/lamp/buildout.cfg
+1
-1
stack/lamp/instance-resilient.cfg
stack/lamp/instance-resilient.cfg
+8
-0
stack/resilient/buildout.cfg
stack/resilient/buildout.cfg
+1
-1
stack/resilient/template-replicated.cfg
stack/resilient/template-replicated.cfg
+5
-1
No files found.
slapos/recipe/request.py
View file @
bcd98f53
...
@@ -123,20 +123,30 @@ class Recipe(object):
...
@@ -123,20 +123,30 @@ class Recipe(object):
isSlave
=
options
.
get
(
'slave'
,
''
).
lower
()
in
\
isSlave
=
options
.
get
(
'slave'
,
''
).
lower
()
in
\
librecipe
.
GenericBaseRecipe
.
TRUE_VALUES
librecipe
.
GenericBaseRecipe
.
TRUE_VALUES
self
.
instance
=
instance
=
request
(
software_url
,
software_type
,
self
.
instance
=
request
(
software_url
,
software_type
,
name
,
partition_parameter_kw
=
partition_parameter_kw
,
name
,
partition_parameter_kw
=
partition_parameter_kw
,
filter_kw
=
filter_kw
,
shared
=
isSlave
)
filter_kw
=
filter_kw
,
shared
=
isSlave
)
self
.
_raise_resource_not_ready
=
None
try
:
# XXX what is the right way to get a global id?
options
[
'instance_guid'
]
=
self
.
instance
.
getId
()
except
slapmodule
.
ResourceNotReady
as
exc
:
self
.
_raise_resource_not_ready
=
exc
for
param
in
return_parameters
:
for
param
in
return_parameters
:
try
:
try
:
options
[
'connection-%s'
%
param
]
=
str
(
options
[
'connection-%s'
%
param
]
=
str
(
instance
.
getConnectionParameter
(
param
))
self
.
instance
.
getConnectionParameter
(
param
))
except
(
slapmodule
.
NotFoundError
,
slapmodule
.
ServerError
):
except
(
slapmodule
.
NotFoundError
,
slapmodule
.
ServerError
):
options
[
'connection-%s'
%
param
]
=
''
options
[
'connection-%s'
%
param
]
=
''
if
self
.
failed
is
None
:
if
self
.
failed
is
None
:
self
.
failed
=
param
self
.
failed
=
param
def
install
(
self
):
def
install
(
self
):
if
self
.
_raise_resource_not_ready
:
raise
slapmodule
.
ResourceNotReady
(
self
.
_resource_not_ready
)
if
self
.
failed
is
not
None
:
if
self
.
failed
is
not
None
:
# Check instance status to know if instance has been deployed
# Check instance status to know if instance has been deployed
try
:
try
:
...
...
stack/lamp/buildout.cfg
View file @
bcd98f53
...
@@ -94,7 +94,7 @@ context = key templateapache template-apache-php:output
...
@@ -94,7 +94,7 @@ context = key templateapache template-apache-php:output
import-list = file parts template-parts:destination
import-list = file parts template-parts:destination
file replicated template-replicated:destination
file replicated template-replicated:destination
md5sum =
03aafcba5c626a4a1bd180d71007be1e
md5sum =
d96890f5cde5a6db3a71926002000082
mode = 0644
mode = 0644
...
...
stack/lamp/instance-resilient.cfg
View file @
bcd98f53
...
@@ -121,6 +121,8 @@ config-notify = ${request-pull-backup-server:connection-notification-url}
...
@@ -121,6 +121,8 @@ config-notify = ${request-pull-backup-server:connection-notification-url}
config-notification-id = ${slap-connection:computer-id}-${slap-connection:partition-id}-apache-pull
config-notification-id = ${slap-connection:computer-id}-${slap-connection:partition-id}-apache-pull
config-frequency = 30 * * * *
config-frequency = 30 * * * *
slave = true
slave = true
sla = instance_guid
sla-instance_guid = ${request-pull-backup-server:instance_guid}
[request-pull-backup-server-apache-2]
[request-pull-backup-server-apache-2]
<= request-pbs-common
<= request-pbs-common
...
@@ -134,6 +136,8 @@ config-notify = ${request-pull-backup-server:connection-notification-url}
...
@@ -134,6 +136,8 @@ config-notify = ${request-pull-backup-server:connection-notification-url}
config-notification-id = ${slap-connection:computer-id}-${slap-connection:partition-id}-apache-pull
config-notification-id = ${slap-connection:computer-id}-${slap-connection:partition-id}-apache-pull
config-frequency = 30 * * * *
config-frequency = 30 * * * *
slave = true
slave = true
sla = instance_guid
sla-instance_guid = ${request-pull-backup-server:instance_guid}
[request-pull-backup-server-apache-backup-1]
[request-pull-backup-server-apache-backup-1]
...
@@ -146,6 +150,8 @@ config-type = push
...
@@ -146,6 +150,8 @@ config-type = push
config-server-key = ${request-apache-backup-1:connection-ssh-public-key}
config-server-key = ${request-apache-backup-1:connection-ssh-public-key}
config-on-notification = ${request-pull-backup-server:connection-feeds-url}${request-pull-backup-server-apache-1:config-notification-id}
config-on-notification = ${request-pull-backup-server:connection-feeds-url}${request-pull-backup-server-apache-1:config-notification-id}
slave = true
slave = true
sla = instance_guid
sla-instance_guid = ${request-pull-backup-server:instance_guid}
[request-pull-backup-server-apache-backup-2]
[request-pull-backup-server-apache-backup-2]
<= request-pbs-common
<= request-pbs-common
...
@@ -157,6 +163,8 @@ config-type = push
...
@@ -157,6 +163,8 @@ config-type = push
config-server-key = ${request-apache-backup-2:connection-ssh-public-key}
config-server-key = ${request-apache-backup-2:connection-ssh-public-key}
config-on-notification = ${request-pull-backup-server:connection-feeds-url}${request-pull-backup-server-apache-2:config-notification-id}
config-on-notification = ${request-pull-backup-server:connection-feeds-url}${request-pull-backup-server-apache-2:config-notification-id}
slave = true
slave = true
sla = instance_guid
sla-instance_guid = ${request-pull-backup-server:instance_guid}
[directory]
[directory]
...
...
stack/resilient/buildout.cfg
View file @
bcd98f53
...
@@ -51,7 +51,7 @@ mode = 0644
...
@@ -51,7 +51,7 @@ mode = 0644
[template-replicated]
[template-replicated]
recipe = slapos.recipe.download
recipe = slapos.recipe.download
url = ${:_profile_base_location_}/template-replicated.cfg
url = ${:_profile_base_location_}/template-replicated.cfg
md5sum =
61780842ccda1600a102456b0da69ac9
md5sum =
140beeb9193e0580e42a6004b9e3821f
mode = 0644
mode = 0644
destination = ${buildout:directory}/template-replicated.cfg
destination = ${buildout:directory}/template-replicated.cfg
...
...
stack/resilient/template-replicated.cfg
View file @
bcd98f53
...
@@ -135,6 +135,8 @@ config-notify = ${request-pbs-{{namebase}}-{{id}}:connection-notification-url}
...
@@ -135,6 +135,8 @@ config-notify = ${request-pbs-{{namebase}}-{{id}}:connection-notification-url}
config-notification-id = ${slap-connection:computer-id}-${slap-connection:partition-id}-{{namebase}}-{{id}}-pull
config-notification-id = ${slap-connection:computer-id}-${slap-connection:partition-id}-{{namebase}}-{{id}}-pull
config-title = Pulling from {{namebase}}
config-title = Pulling from {{namebase}}
slave = true
slave = true
sla = instance_guid
sla-instance_guid = ${request-pbs-{{namebase}}-{{id}}:instance_guid}
[request-pull-backup-server-{{namebase}}-backup-{{id}}]
[request-pull-backup-server-{{namebase}}-backup-{{id}}]
<= request-pbs-common
<= request-pbs-common
...
@@ -149,6 +151,8 @@ config-notify = ${request-{{namebase}}-pseudo-replicating-{{id}}:connection-noti
...
@@ -149,6 +151,8 @@ config-notify = ${request-{{namebase}}-pseudo-replicating-{{id}}:connection-noti
config-notification-id = ${request-{{namebase}}-pseudo-replicating-{{id}}:pbs-notification-id}
config-notification-id = ${request-{{namebase}}-pseudo-replicating-{{id}}:pbs-notification-id}
config-title = Pushing to {{namebase}} backup {{id}}
config-title = Pushing to {{namebase}} backup {{id}}
slave = true
slave = true
sla = instance_guid
sla-instance_guid = ${request-pbs-{{namebase}}-{{id}}:instance_guid}
{% endfor %}
{% endfor %}
{% endmacro %}
{% endmacro %}
\ No newline at end of file
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