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
Kwabena Antwi-Boasiako
slapos
Commits
dc53ebbb
Commit
dc53ebbb
authored
Feb 19, 2013
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'lapp-resilient3'
parents
b6c6de9d
23136175
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
44 deletions
+16
-44
slapos/recipe/softwaretype.py
slapos/recipe/softwaretype.py
+8
-4
stack/lamp/buildout.cfg
stack/lamp/buildout.cfg
+1
-1
stack/lamp/instance-resilient.cfg.jinja2
stack/lamp/instance-resilient.cfg.jinja2
+1
-1
stack/resilient/buildout.cfg
stack/resilient/buildout.cfg
+1
-1
stack/resilient/template-replicated.cfg.in
stack/resilient/template-replicated.cfg.in
+5
-37
No files found.
slapos/recipe/softwaretype.py
View file @
dc53ebbb
...
...
@@ -114,10 +114,14 @@ class Recipe:
if
not
buildout
.
has_section
(
'slap-parameter'
):
buildout
.
add_section
(
'slap-parameter'
)
for
parameter
,
value
in
self
.
parameter_dict
.
items
():
if
isinstance
(
value
,
str
):
buildout
.
set
(
'slap-parameter'
,
parameter
,
value
)
else
:
buildout
.
set
(
'slap-parameter'
,
parameter
,
json
.
dumps
(
value
))
# All parameters evaluating to False are... False, and shouldn't
# convey any information.
# Here, all those parameters are set to empty string.
if
value
:
if
isinstance
(
value
,
str
):
buildout
.
set
(
'slap-parameter'
,
parameter
,
value
)
else
:
buildout
.
set
(
'slap-parameter'
,
parameter
,
json
.
dumps
(
value
))
buildout
.
add_section
(
'slap-network-information'
)
buildout
.
set
(
'slap-network-information'
,
'local-ipv4'
,
...
...
stack/lamp/buildout.cfg
View file @
dc53ebbb
...
...
@@ -109,7 +109,7 @@ context = key buildout buildout:bin-directory
import-list = file parts template-parts:destination
file replicated template-replicated:destination
md5sum =
5d26d6427094c7779793cc86b4954774
md5sum =
4fca584cf65e0120ecedb0aa1eb467ca
mode = 0644
[instance-mariadb]
...
...
stack/lamp/instance-resilient.cfg.jinja2
View file @
dc53ebbb
...
...
@@ -19,7 +19,7 @@ parts +=
[request-apache]
return = url ssh-public-key ssh-url notification-id ip url backend_url
# XXX: hardcoded values
config = mariadb1-computer-guid pbs-mariadb1-computer-guid mariadb2-computer-guid pbs-mariadb2-computer-guid mariadb3-computer-guid pbs-mariadb3-computer-guid
config =
number authorized-key notify ip-list namebase
mariadb1-computer-guid pbs-mariadb1-computer-guid mariadb2-computer-guid pbs-mariadb2-computer-guid mariadb3-computer-guid pbs-mariadb3-computer-guid
config-mariadb1-computer-guid = ${slap-parameter:mariadb1-computer-guid}
config-pbs-mariadb1-computer-guid = ${slap-parameter:pbs-mariadb1-computer-guid}
config-mariadb2-computer-guid = ${slap-parameter:mariadb2-computer-guid}
...
...
stack/resilient/buildout.cfg
View file @
dc53ebbb
...
...
@@ -53,7 +53,7 @@ mode = 0644
[template-replicated]
recipe = slapos.recipe.download
url = ${:_profile_base_location_}/template-replicated.cfg.in
md5sum =
589065f6df3b15df08afcb812f869fcf
md5sum =
9e20f283bf709c63c9c6692d5e1f8972
mode = 0644
destination = ${buildout:directory}/template-replicated.cfg.in
...
...
stack/resilient/template-replicated.cfg.in
View file @
dc53ebbb
...
...
@@ -7,6 +7,9 @@ config-namebase = {{namebase}}
software-url = ${slap-connection:software-release-url}
## Every request is double to provide the 3 IPs.
## First, we request with ip-list parameter hardcoded.
## Then, we request the same thing without this.
## XXX-Cedric: is it useful?
[request-{{namebase}}]
<= resilient
slap-connection
...
...
@@ -53,48 +56,13 @@ sla-computer_guid = ${slap-parameter:{{namebase}}{{id}}-computer-guid}
config-ip-list = ${request-{{namebase}}:connection-ip}{% for j in range(1,nbbackup|int) %} ${request-{{namebase}}-pseudo-replicating-{{j}}:connection-ip}{% endfor %}
[request-{{namebase}}-2]
<= resilient
slap-connection
<= request-{{namebase}}
iplist
{{heriteLeader}}
recipe = slapos.cookbook:request
name = {{namebase}}0
software-url = ${slap-connection:software-release-url}
software-type = {{typeexport}}
return = ssh-public-key ssh-url notification-id ip
config = number authorized-key notify ip-list namebase
config-number = 0
config-authorized-key = {% for id in range(1,nbbackup|int) %} ${request-pbs-{{namebase}}-{{id}}:connection-ssh-key}{% endfor %}
config-notify = {% for id in range(1,nbbackup|int) %} ${request-pbs-{{namebase}}-{{id}}:connection-notification-url}{% endfor %}
{% for id in range(1,nbbackup|int) %}
[request-{{namebase}}-pseudo-replicating-{{id}}-2]
<= slap-connection
resilient
<= request-{{namebase}}-pseudo-replicating-{{id}}
iplist
{{heriteBackup}}
recipe = slapos.cookbook:request
name = {{namebase}}{{id}}
software-url = ${slap-connection:software-release-url}
software-type = {{typeimport}}
return = ssh-public-key ssh-url notification-url
pbs-notification-id = ${slap-connection:computer-id}-${slap-connection:partition-id}-{{namebase}}-push
config = number authorized-key on-notification ip-list namebase
config-number = {{id}}
config-authorized-key = ${request-pbs-{{namebase}}-{{id}}:connection-ssh-key}
config-on-notification = ${request-pbs-{{namebase}}-{{id}}:connection-feeds-url}${:pbs-notification-id}
sla = computer_guid
sla-computer_guid = ${slap-parameter:{{namebase}}{{id}}-computer-guid}
{% endfor %}
...
...
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