Commit 1cfe05a8 authored by Łukasz Nowak's avatar Łukasz Nowak

repo: Provide one command for the end user

As the process of installing from ERP5 can be controlled with a script,
create such script instead of many steps.

This script is safe to be run many times.
parent 394e7d06
...@@ -40,40 +40,8 @@ Usage - instruction to user installing with RPMs ...@@ -40,40 +40,8 @@ Usage - instruction to user installing with RPMs
Required machine is CentOS 7.4 with at least Netinstall. Required machine is CentOS 7.4 with at least Netinstall.
The RPMs shall be downloaded and to one directory, from which all below commands Provide all RPMs with `install.sh` in one directory (eg. tarball).
will be run.
Ask user to run `install.sh` as `root`.
Procedure, all with `root` user:
More instructions will be provided after running this script.
* uninstall firewalld: `yum remove -y firewalld` \ No newline at end of file
* install slapos.node: `yum install -y slapos.node*rpm`
* add local IPv6: `ip -6 addr add 2001::1/64 dev lo`
* create directories: `mkdir -p /opt/slapgrid /srv/slapgrid`
* configure the node: `slapos configure local`
* kill supervisor: ``kill `cat /srv/slapgrid/var/run/supervisord.pid ```
* wait a bit: `sleep 5`
* boot the supervisor: `slapos node instance --now --verbose`
* wait a bit: `sleep 15`
* format the machine: `slapos node format --now --alter_user=True`
* install ERP5 code: `yum install -y erp5*rpm`
Now by using playbook the user can check if all is working:
``ansible-playbook /opt/slapos.playbook/erp5-standalone.yml``
The expected result is:
```
TASK [standalone-shared : Expose ERP5] ***************************************************************
ok: [<machine_public_ipv4>] => {
"msg": [
"Build successful, connect to:",
" https://<machine_public_ipv4>",
"",
" with",
" username: zope password: uqagckyo"
]
}
```
where <machine_public_ipv4> is replaced with public IPv4 of the machine.
\ No newline at end of file
#!/bin/sh
LOG_FILE=install.log
echo -n "Started at " >> $LOG_FILE 2>&1
date >> $LOG_FILE 2>&1
echo -n "Bootstraping the system..."
yum remove -y firewalld >> $LOG_FILE 2>&1
yum install -y slapos.node*rpm >> $LOG_FILE 2>&1
ip -6 addr add 2001::1/64 dev lo >> $LOG_FILE 2>&1
mkdir -p /opt/slapgrid /srv/slapgrid >> $LOG_FILE 2>&1
slapos configure local >> $LOG_FILE 2>&1
pgrep -f 'slapos proxy' >/dev/null || (
kill `cat /srv/slapgrid/var/run/supervisord.pid` >> $LOG_FILE 2>&1
sleep 5 >> $LOG_FILE 2>&1
slapos node instance --now --verbose >> $LOG_FILE 2>&1
sleep 15 >> $LOG_FILE 2>&1
)
echo "done."
echo -n "Preparing the machine for SlapOS..."
slapos node format --now --alter_user=True >> $LOG_FILE 2>&1
echo "done."
echo -n "Installing ERP5 software..."
yum install -y erp5*rpm >> $LOG_FILE 2>&1
echo "done."
echo -n "Instantiating ERP5 instance..."
for i in `seq 10` ; do
ansible-playbook /opt/slapos.playbook/erp5-standalone.yml >> $LOG_FILE 2>&1
ANSIBLE_RESULT=$?
if [ "$ANSIBLE_RESULT" == "0" ] ; then
break
fi
sleep 5m
done
echo "done."
if [ "$ANSIBLE_RESULT" == "0" ] ; then
echo "The instance is ready. Please connect to:"
tail -n 20 $LOG_FILE | grep https
tail -n 20 $LOG_FILE | grep username
exit 0
else
echo "There was a problem with installation."
echo "Please inspect 'install.log' for details."
echo "While submitting support request, please attach 'install.log' file."
exit 1
fi
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment