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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kasra Jamshidi
slapos.package
Commits
a387f278
Commit
a387f278
authored
Dec 13, 2016
by
Kasra Jamshidi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First try at apache-frontend play
parent
d2e35b53
Pipeline
#4239
skipped
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
0 deletions
+77
-0
playbook/apache-frontend-cdn.yml
playbook/apache-frontend-cdn.yml
+12
-0
playbook/roles/apache-frontend/tasks/main.yml
playbook/roles/apache-frontend/tasks/main.yml
+24
-0
playbook/roles/apache-frontend/templates/request-apache-frontend.j2
...oles/apache-frontend/templates/request-apache-frontend.j2
+41
-0
playbook/roles/apache-frontend/templates/start-script.j2
playbook/roles/apache-frontend/templates/start-script.j2
+0
-0
No files found.
playbook/apache-frontend-cdn.yml
0 → 100644
View file @
a387f278
-
name
:
a play that runs entirely on the ansible host
hosts
:
127.0.0.1
connection
:
local
vars
:
software_release_url
:
https://lab.nexedi.com/kasra/slapos/raw/master/software/apache-frontend/software.cfg
startup_playbook_id
:
apache-frontend-cdn.yml
playbook_name
:
apache-frontend
request_instance_template
:
request-apache-frontend.j2
roles
:
-
apache-frontend
playbook/roles/apache-frontend/tasks/main.yml
0 → 100644
View file @
a387f278
---
-
name
:
create partition script
template
:
src={{ request_instance_template }} dest=/tmp/playbook-request-{{ playbook_name }} mode=700
-
name
:
Supply and Request CDN
shell
:
cat /tmp/playbook-request-{{ playbook_name }} | slapos console
-
name
:
Add startup script
template
:
src=start-script.j2 dest=/usr/local/bin/{{ playbook_name }}-startup mode=755
# - name: Include on reboot
# cron: name="Start Up script" special_time=reboot job="/usr/local/bin/{{ playbook_name }}-startup >> /var/log/{{ playbook_name }}-startup.log 2>&1"
-
name
:
Get slapos.playbook directory name
shell
:
cd /tmp/tmpplaybookapache-frontend-cdn.*/slapos.playbook.git/playbook/; echo $(pwd)/
register
:
tmp_dir
-
name
:
Check if /opt/slapos.playbook already exists
stat
:
path=/opt/slapos.playbook/
register
:
playbook_state
-
name
:
Copy slapos.playbook
copy
:
src={{ tmp_dir.stdout }} dest=/opt/slapos.playbook/
when
:
playbook_state.stat.exists == False
playbook/roles/apache-frontend/templates/request-apache-frontend.j2
0 → 100644
View file @
a387f278
import json
software_url = '{{ software_release_url }}'
computer_id = 'local_computer'
#supply(software_url, computer_id)
master_parameter_dict = {
"domain":"localhost:8080",
"public-ipv4":"127.0.0.1",
}
slave_parameter_dict = {
"url":"https://[::1]:8080/erp5",
"type":"zope",
}
# Choose a title
master_title = "instance-of-{{ playbook_name }}-master"
# request master
request(software_url,
master_title,
filter_kw={'computer_guid': computer_id},
software_type='default',
partition_parameter_kw={
'_': json.dumps(master_parameter_dict, sort_keys=True, indent=2),
}
)
slave_title = "instance-of-{{ playbook_name }}-slave"
# request slave
request(software_url,
slave_title,
software_type='RootSoftwareInstance',
shared=True,
partition_parameter_kw={
'_': json.dumps(parameter_dict, sort_keys=True, indent=2),
}
)
playbook/roles/apache-frontend/templates/start-script.j2
0 → 100644
View file @
a387f278
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