Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.playbook
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
slapos.playbook
Commits
9a580929
Commit
9a580929
authored
May 25, 2015
by
Kristopher Ruzic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert base-setup, move startup script to ansible install
parent
c97a705e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
26 deletions
+24
-26
install/base-setup
install/base-setup
+1
-1
install/erp5-standalone
install/erp5-standalone
+4
-25
playbook/roles/erp5-standalone/files/erp5-startup
playbook/roles/erp5-standalone/files/erp5-startup
+10
-0
playbook/roles/erp5-standalone/tasks/main.yml
playbook/roles/erp5-standalone/tasks/main.yml
+9
-0
No files found.
install/base-setup
View file @
9a580929
...
...
@@ -12,7 +12,7 @@ fi
source
/tmp/function-common
function
download_playbook
{
DFILE
=
"/
opt/slapos.playbook
/"
DFILE
=
"/
tmp/tmpplaybook
$(
basename
$0
)
.
$$
/"
TFILE
=
"archive.tar.gz"
mkdir
-p
$DFILE
cd
$DFILE
...
...
install/erp5-standalone
View file @
9a580929
...
...
@@ -2,40 +2,19 @@
PLAYBOOK_REPOSITORY_URL
=
https://lab.nexedi.cn/rafael/slapos.playbook/repository/archive.tar.gz?ref
=
master
PLAYBOOK_FILE
=
erp5-standalone.yml
STARTUP_FILE
=
/usr/local/bin/erp5-startup
EXE_PATH
=
"
`
dirname
\"
$0
\"
`
"
echo
"Running from
$EXE_PATH
"
#### First run of this script ####
if
[
-f
$STARTUP_FILE
]
;
then
# let the user know
echo
"Script has been run previously, use the script in /usr/local/bin unless upgrading"
else
# save the startup script to /usr/local/bin
# and mark it as executable
# temporary download url
wget
--no-check-certificate
https://lab.nexedi.cn/krruzic/slapos.playbook/raw/master/install/erp5-startup
-O
$STARTUP_FILE
chmod
-x
$STARTUP_FILE
# add as the second to last line (last line is `exit 0`)
sed
-i
-e
'$i \bash /usr/local/bin/erp5-startup &\n'
/etc/rc.local
echo
"Script added to startup"
fi
#### Setup Ansible and load few libraries #####
BASE_SETUP_SCRIPT_MD5
=
e2c9b43ccff6e606ad25cd1df0e2705f
mkdir
-p
/opt/slapos.playbook/
wget
--no-check-certificate
https://deploy.nexedi.cn/base-setup
-O
/
opt/slapos.playbook
/base-setup
wget
--no-check-certificate
https://deploy.nexedi.cn/base-setup
-O
/
tmp
/base-setup
if
[
"
`
md5sum
/
opt/slapos.playbook
/base-setup |
cut
-f1
-d
\
`
"
!=
"
$BASE_SETUP_SCRIPT_MD5
"
]
;
then
echo
"ERROR: base-setup has wrong md5
`
md5sum
/
opt/slapos.playbook
/base-setup |
cut
-f1
-d
\
`
!=
$BASE_SETUP_SCRIPT_MD5
"
if
[
"
`
md5sum
/
tmp
/base-setup |
cut
-f1
-d
\
`
"
!=
"
$BASE_SETUP_SCRIPT_MD5
"
]
;
then
echo
"ERROR: base-setup has wrong md5
`
md5sum
/
tmp
/base-setup |
cut
-f1
-d
\
`
!=
$BASE_SETUP_SCRIPT_MD5
"
exit
1
fi
source
/
opt/slapos.playbook
/base-setup
source
/
tmp
/base-setup
download_playbook
$PLAYBOOK_REPOSITORY_URL
...
...
install
/erp5-startup
→
playbook/roles/erp5-standalone/files
/erp5-startup
View file @
9a580929
#!/bin/bash
# Reruns the ansible playbook, does nothing else
PLAYBOOK_ROOT
=
/opt/slapos.playbook/playbook/
PLAYBOOK_FILE
=
erp5-standalone.yml
source
/opt/slapos.playbook/base-setup
cd
$PLAYBOOK_ROOT
# cd into the playbook directory
echo
"Starting Ansible playbook:"
ansible-playbook
$PLAYBOOK_FILE
-i
hosts
--connection
=
local
playbook/roles/erp5-standalone/tasks/main.yml
View file @
9a580929
...
...
@@ -14,3 +14,12 @@
-
name
:
Request ERP5 Cluster
shell
:
cat /tmp/playbook-request-erp5-cluster | slapos console
-
name
:
Add startup script
copy
:
src=erp5-startup dest=/usr/local/bin/erp5-startup mode=755
-
name
:
Add to rc.local
shell
:
sed -i -e '$i \bash /usr/local/bin/erp5-startup &\n' /etc/rc.local
-
name
:
Move playbooks to permanent location
shell
:
cp
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