Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
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
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
slapos.package
Commits
e1e1f0bd
Commit
e1e1f0bd
authored
Mar 15, 2019
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kdbox: stabilize scripts
parent
110c5f11
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
23 deletions
+27
-23
playbook/kdbox-playbook.yml
playbook/kdbox-playbook.yml
+4
-2
playbook/roles/kdbox/tasks/frontend-slave-instance.yml
playbook/roles/kdbox/tasks/frontend-slave-instance.yml
+2
-1
playbook/roles/kdbox/tasks/frontend.yml
playbook/roles/kdbox/tasks/frontend.yml
+11
-5
playbook/roles/kdbox/tasks/main.yml
playbook/roles/kdbox/tasks/main.yml
+0
-11
playbook/roles/kdbox/tasks/webrunner.yml
playbook/roles/kdbox/tasks/webrunner.yml
+10
-4
No files found.
playbook/kdbox-playbook.yml
View file @
e1e1f0bd
...
...
@@ -13,6 +13,8 @@
-
name
:
"
re6sttoken"
prompt
:
"
\n\n
You
are
running
the
KDBox
Installer
\n\n
Please
request
a
re6stnet
token
on
https://slapos.vifib.com.
\n\n
You
will
also
need
computer
and
account
token,
please
get
them
on
https://slapos.vifib.com.
\n\n
A
domain
name
will
be
required
for
kdbox
slave
frontend,
to
access
erp5
later.
\n\n
Enter
your
re6stnet
token:
"
private
:
no
...
...
playbook/roles/kdbox/tasks/frontend-slave-instance.yml
View file @
e1e1f0bd
---
# get ERP5 URL will fail if erp5 instance is not ready
-
name
:
Get ERP5 backend URL
shell
:
"
{{
role_path
}}/files/kdbox-param
'{{
webrunner_instance_name
}}'
url"
register
:
erp5_url
...
...
@@ -9,7 +10,7 @@
-
name
:
requesting CDN slave instance for ERP5
shell
:
echo "request('{{ frontend_software_release_url }}', '{{ custom_domain }}-slave',filter_kw={'computer_guid':'{{ computer_id }}'},partition_parameter_kw={'custom_domain':'{{ custom_domain }}','enable_cache':'true','type':'zope','url':'{{ erp5_url.stdout }}', 'path':'erp5/',},shared=True, software_type='custom-personal',)" | slapos console
when
:
supply_is_done == True and
cert_folder.stat.exists == False
when
:
cert_folder.stat.exists == False
register
:
request_slave
failed_when
:
"
'error'
in
request_slave.stdout"
...
...
playbook/roles/kdbox/tasks/frontend.yml
View file @
e1e1f0bd
...
...
@@ -3,15 +3,21 @@
-
stat
:
path=/opt/kdbox/frontend_requested
register
:
frontend_requested
-
stat
:
path=/opt/kdbox/frontend_supplied
register
:
frontend_supplied
-
name
:
Caddy frontend supply
shell
:
slapos supply {{ frontend_software_release_url }} {{ computer_id }}
when
:
slapos_cfg.stat.exists == True
args
:
creates
:
/opt/supply_check_file
when
:
slapos_cfg.stat.exists == True and frontend_supplied.stat.exists == False
-
name
:
Frontend is supplied
file
:
path=/opt/kdbox/frontend_supplied state=touch
-
name
:
Requesting Caddy frontend istance
-
name
:
Requesting Caddy frontend i
n
stance
shell
:
echo "request('{{ frontend_software_release_url }}', '{{ frontend_instance_name }}', filter_kw={'computer_guid':'{{ computer_id}}'}, partition_parameter_kw={'-sla-1-computer_guid':'{{ computer_id }}','domain':'{{ domain_name }}','public-ipv4':'{{ ansible_default_ipv4.address }}',}, software_type='custom-personal',)" | slapos console
when
:
supply_is_done == True and frontend_requested.stat.exists == False
when
:
frontend_supplied.stat.exists == True and frontend_requested.stat.exists == False
register
:
output
failed_when
:
"
'error'
in
output.stderr.lower()"
-
name
:
Frontend is requested
file
:
path=/opt/kdbox/frontend_requested state=touch
...
...
playbook/roles/kdbox/tasks/main.yml
View file @
e1e1f0bd
...
...
@@ -2,10 +2,6 @@
-
file
:
path=/opt/kdbox state=directory mode=0755
-
name
:
check if supply is done
stat
:
path=/opt/kdbox/supply_check_file
register
:
supply_check
-
stat
:
path="/opt/kdbox/kdbox_ok"
register
:
kdbox_is_ok
...
...
@@ -14,7 +10,6 @@
computer_id
:
"
{{
lookup('ini','computer_id
section=slapos
file=/etc/opt/slapos/slapos.cfg')
}}"
domain_name
:
"
{{
lookup('file',
'/opt/kdbox/cdn_domain_name')
}}"
custom_domain
:
"
{{
lookup('file',
'/opt/kdbox/cdn_custom_domain')
}}"
supply_is_done
:
"
{{
supply_check.stat.exists
}}"
kdbox_ok
:
"
{{
kdbox_is_ok.stat.exists
}}"
-
include
:
deploy.yml
...
...
@@ -32,12 +27,6 @@
-
include
:
frontend.yml
-
include
:
frontend-slave-instance.yml
# file created when software supply is done
-
name
:
Software Release are supplied
file
:
path
:
"
/opt/kdbox/supply_check_file"
state
:
touch
# find Caddy ip to be used for port forwarding
-
name
:
Get Caddy local IP
shell
:
grep bind /srv/slapgrid/slappart*/etc/Caddyfile | cut -d ' ' -f4 | head -n1
...
...
playbook/roles/kdbox/tasks/webrunner.yml
View file @
e1e1f0bd
...
...
@@ -3,16 +3,22 @@
-
stat
:
path=/opt/kdbox/webrunner_requested
register
:
webrunner_requested
-
stat
:
path=/opt/kdbox/webrunner_supplied
register
:
webrunner_supplied
-
name
:
webrunner supply
shell
:
slapos supply {{ webrunner_software_release_url }} {{ computer_id }}
when
:
slapos_cfg.stat.exists == True
args
:
creates
:
/opt/kdbox/supply_check_file
when
:
slapos_cfg.stat.exists == True and webrunner_supplied.stat.exists == False
-
name
:
Webrunner is supplied
file
:
path=/opt/kdbox/webrunner_supplied state=touch
-
name
:
requesting webrunner instance
shell
:
echo "request('{{ webrunner_software_release_url }}', '{{ webrunner_instance_name }}', partition_parameter_kw={'-sla-runner0-computer_guid':'{{ computer_id }}','-sla-runner1-computer_guid':'{{ computer_id }}', 'auto-deploy':'true', 'auto-deploy-instance':'true', 'autorun':'true', 'slapos-software':'software/erp5',}, software_type='resilient',)" | slapos console
when
:
supply_is_done == True and webrunner_requested.stat.exists == False
when
:
webrunner_supplied.stat.exists == True and webrunner_requested.stat.exists == False
failed_when
:
"
'error'
in
output.stderr.lower()"
register
:
output
-
name
:
webrunner is requested
file
:
path=/opt/kdbox/webrunner_requested state=touch
when
:
output is defined
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