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
34f0d410
Commit
34f0d410
authored
May 25, 2015
by
Kristopher Ruzic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
write startup script to /etc/rc.local, save playbooks to a permanent location
parent
c35d2605
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
8 deletions
+37
-8
install/erp5-standalone
install/erp5-standalone
+29
-8
install/erp5-startup
install/erp5-startup
+8
-0
No files found.
install/erp5-standalone
View file @
34f0d410
#!/bin/bash
PLAYBOOK_REPOSITORY_URL
=
https://lab.nexedi.cn/rafael/slapos.playbook/repository/archive.tar.gz?ref
=
master
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
BASE_SETUP_SCRIPT_MD5
=
e2c9b43ccff6e606ad25cd1df0e2705f
mkdir
-p
/opt/slapos.playbook/
wget
--no-check-certificate
https://deploy.nexedi.cn/base-setup
-O
/
tmp
/base-setup
wget
--no-check-certificate
https://deploy.nexedi.cn/base-setup
-O
/
opt/slapos.playbook
/base-setup
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
"
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
"
exit
1
fi
source
/
tmp
/base-setup
source
/
opt/slapos.playbook
/base-setup
download_playbook
$PLAYBOOK_REPOSITORY_URL
download_playbook
$PLAYBOOK_REPOSITORY_URL
echo
"Starting Ansible playbook:"
ansible-playbook
$PLAYBOOK_FILE
-i
hosts
--connection
=
local
\ No newline at end of file
ansible-playbook
$PLAYBOOK_FILE
-i
hosts
--connection
=
local
install/erp5-startup
0 → 100644
View file @
34f0d410
#!/bin/bash
# Reruns the ansible playbook, does nothing else
PLAYBOOK_FILE
=
erp5-standalone.yml
source
/opt/slapos.playbook/base-setup
echo
"Starting Ansible playbook:"
ansible-playbook
$PLAYBOOK_FILE
-i
hosts
--connection
=
local
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