Commit 254b0cf9 authored by Rafael Monnerat's avatar Rafael Monnerat

Create erp5-standalone.

parent 99e16acc
......@@ -12,6 +12,8 @@ def render(yml_name, relative_url):
render("slapos.yml", "install/slapos")
render("re6stnet.yml", "install/re6st")
render("erp5-standalone.yml", "install/erp5-standalone")
# gnet
render("gnet-re6stnet.yml", "install/gnet/re6st")
......
#!/bin/bash
PLAYBOOK_REPOSITORY_URL=https://lab.nexedi.cn/rafael/slapos.playbook/repository/archive.tar.gz?ref=master
PLAYBOOK_FILE=erp5-standalone.yml
#### Setup Ansible and load few libraries #####
BASE_SETUP_SCRIPT_MD5=e2c9b43ccff6e606ad25cd1df0e2705f
wget --no-check-certificate https://deploy.nexedi.cn/base-setup -O /tmp/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"
exit 1
fi
source /tmp/base-setup
download_playbook $PLAYBOOK_REPOSITORY_URL
echo "Starting Ansible playbook:"
ansible-playbook $PLAYBOOK_FILE -i hosts --connection=local
\ No newline at end of file
- name: a play that runs entirely on the ansible host
hosts: 127.0.0.1
connection: local
roles:
- erp5-standalone
#!/bin/bash
slapos proxy show -u /opt/slapos/slapproxy.db
import json
software_url = 'http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/slapos-master-cluster:/software/slapos-master/software.cfg'
# Choose a SlapOS Node
# If you are deploying SlapOS Master with Webrunner, then computer_id is 'slaprunner'
computer_id = 'local_computer'
parameter_dict = {
"timezone": "UTC",
"site-id": "erp5",
"bt5": "erp5_full_text_myisam_catalog slapos_configurator",
"zope-partition-dict": {
"activities-node": {
"family": "activities",
"thread-amount": 4,
"instance-count": 1,
"timerserver-interval": 1,
"computer-guid": computer_id,
},
"distribution-node": {
"family": "distribution",
"thread-amount": 1,
"instance-count": 1,
"computer-guid": computer_id,
"port-base": 2210,
"timerserver-interval": 1,
},
},
"mariadb-computer-guid": computer_id,
"mariadb": {
"test-database-amount": 0
},
"zodb-software-type": "zeo",
"zodb-computer-guid": computer_id,
"zodb": {
"root": {
"cache-size": 1500,
"storage-dict": {
"client": {
"cache-size": "100MB"
}
}
}
}
}
# Choose a title
title = "instance-of-erp5-cluster"
request(software_url,
title,
filter_kw={'computer_guid': computer_id},
software_type='create-erp5-site',
partition_parameter_kw={
'_': json.dumps(parameter_dict, sort_keys=True, indent=2),
}
)
---
dependencies:
- slapos-proxy
---
- name: Add ipv6 to lo interface
shell: ip -6 addr add 2001::1/64 dev lo
ignore_errors: True
- name: Supply erp5 software release
shell: slapos supply http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/erp5-cluster:/software/erp5/software.cfg local_computer
- name: create partition script
copy: src=request-erp5-cluster dest=/tmp/playbook-request-erp5-cluster mode=700
- name: create erp5-show
copy: src=erp5-show dest=/usr/local/bin/erp5-show mode=755
- name: Request ERP5 Cluster
shell: cat /tmp/playbook-request-erp5-cluster | slapos console
---
dependencies:
- { role: repository }
- name: Install packages using apt
apt: name=slapos-node state=present update_cache=yes cache_valid_time=3600
when: ansible_os_family == "Debian"
- name: Install re6stnet on CentOS
yum: name=slapos.node state=present update_cache=yes
when: ansible_os_family == "RedHat"
- name: Check if configuration exists already
stat: path=/etc/opt/slapos/slapos.cfg
register: slapos_cfg
- name: Configure SlapOS with slapos configure local
shell: "slapos configure local"
when: slapos_cfg.stat.exists == False
- name: Wait for proxy
wait_for: host=127.0.0.1 port=8080 delay=10
- name: Run slapos format for initial bootstrap
service: "slapos node format --now"
when: slapos_cfg.stat.exists == False
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