Commit 8f16b9c1 authored by Alain Takoudjou's avatar Alain Takoudjou

Merge branch 'master' into logging

parents 587c5465 7436ece4
...@@ -16,5 +16,28 @@ ...@@ -16,5 +16,28 @@
private: no private: no
default: "noname" default: "noname"
- name: "interface_name"
prompt: "What is the interface used by re6st:"
private: no
default: "noname"
post_tasks:
- name: Add default
lineinfile: dest=/etc/re6stnet/re6stnet.conf line="default"
- name: Max Clients
lineinfile: dest=/etc/re6stnet/re6stnet.conf line="max-clients 1"
- name: Client count
lineinfile: dest=/etc/re6stnet/re6stnet.conf line="client-count 0"
- name: Include interface
lineinfile: dest=/etc/re6stnet/re6stnet.conf line="client-count {{ interface_name }}"
when: interface_name != "noname"
- name: restart re6st-node service
service: name=re6st-node state=restarted enabled=yes
roles: roles:
- re6stnet - re6stnet
...@@ -6,11 +6,6 @@ ...@@ -6,11 +6,6 @@
- settings/imt.yml - settings/imt.yml
vars_prompt: vars_prompt:
- name: "re6sttoken"
prompt: "If you have re6st token if you have (ignore if you already have a configured re6st):"
private: no
default: "notoken"
- name: "computer_name" - name: "computer_name"
prompt: "What is this computer name? (ignore if you already have a configured re6st and slapos):" prompt: "What is this computer name? (ignore if you already have a configured re6st and slapos):"
private: no private: no
...@@ -22,8 +17,5 @@ ...@@ -22,8 +17,5 @@
default: "notoken" default: "notoken"
roles: roles:
- { role: re6stnet, package_state: present }
- { role: slapos, package_state: present } - { role: slapos, package_state: present }
- { role: package, package_name: ntp, package_state: present } - { role: package, package_name: ntp, package_state: present }
...@@ -11,7 +11,9 @@ ...@@ -11,7 +11,9 @@
command: mkdir -p {{ base_path }}/{{ item }} command: mkdir -p {{ base_path }}/{{ item }}
with_items: with_items:
- install/gnet/ - install/gnet/
- install/unstable/gnet/
- install/imt/ - install/imt/
- install/unstable/imt/
- name: generate scripts - name: generate scripts
template: src=roles/install-script/templates/base_setup.j2 dest={{ base_path }}/install/base-setup mode=0666 template: src=roles/install-script/templates/base_setup.j2 dest={{ base_path }}/install/base-setup mode=0666
...@@ -36,18 +38,36 @@ ...@@ -36,18 +38,36 @@
copy: src=roles/install-script/files/index.html dest={{ base_path }}/install/imt/index.html mode=0666 copy: src=roles/install-script/files/index.html dest={{ base_path }}/install/imt/index.html mode=0666
roles: roles:
- { role: "install-script", playbook_yml: "slapos.yml", script_path: "install/slapos" } - { role: "install-script", channel: "stable", playbook_yml: "slapos.yml", script_path: "install/slapos" }
- { role: "install-script", playbook_yml: "re6stnet.yml", script_path: "install/re6st"} - { role: "install-script", channel: "stable", playbook_yml: "re6stnet.yml", script_path: "install/re6st"}
- { role: "install-script", playbook_yml: "vifib.yml", script_path: "install/vifib"} - { role: "install-script", channel: "stable", playbook_yml: "vifib.yml", script_path: "install/vifib"}
- { role: "install-script", playbook_yml: "vifib-shuttle.yml", script_path: "install/vifib-shuttle"} - { role: "install-script", channel: "stable", playbook_yml: "vifib-shuttle.yml", script_path: "install/vifib-shuttle"}
- { role: "install-script", playbook_yml: "erp5-standalone.yml", script_path: "install/erp5-standalone"} - { role: "install-script", channel: "stable", playbook_yml: "erp5-standalone.yml", script_path: "install/erp5-standalone"}
- { role: "install-script", playbook_yml: "wendelin-standalone.yml", script_path: "install/wendelin-standalone"} - { role: "install-script", channel: "stable", playbook_yml: "wendelin-standalone.yml", script_path: "install/wendelin-standalone"}
- { role: "install-script", playbook_yml: "slapos-test-node.yml", script_path: "install/slapos-test-node"} - { role: "install-script", channel: "stable", playbook_yml: "slapos-test-node.yml", script_path: "install/slapos-test-node"}
- { role: "install-script", playbook_yml: "gnet-re6stnet.yml", script_path: "install/gnet/re6st"} - { role: "install-script", channel: "stable", playbook_yml: "gnet-re6stnet.yml", script_path: "install/gnet/re6st"}
- { role: "install-script", playbook_yml: "gnet-server.yml", script_path: "install/gnet/slapos"} - { role: "install-script", channel: "stable", playbook_yml: "gnet-server.yml", script_path: "install/gnet/slapos"}
- { role: "install-script", playbook_yml: "imt-server-update.yml", script_path: "install/imt/slapos-update"} - { role: "install-script", channel: "stable", playbook_yml: "imt-server-update.yml", script_path: "install/imt/slapos-update"}
- { role: "install-script", playbook_yml: "imt-server.yml", script_path: "install/imt/slapos"} - { role: "install-script", channel: "stable", playbook_yml: "imt-server.yml", script_path: "install/imt/slapos"}
- { role: "install-script", playbook_yml: "imt-vm-bootstrap.yml", script_path: "install/imt/vm-bootstrap"} - { role: "install-script", channel: "stable", playbook_yml: "imt-vm-bootstrap.yml", script_path: "install/imt/vm-bootstrap"}
- { role: "install-script", playbook_yml: "imt-vm-cloudera-manager.yml", script_path: "install/imt/vm-cloudera-manager"} - { role: "install-script", channel: "stable", playbook_yml: "imt-vm-cloudera-manager.yml", script_path: "install/imt/vm-cloudera-manager"}
- { role: "install-script", playbook_yml: "imt-re6stnet.yml", script_path: "install/imt/re6st"} - { role: "install-script", channel: "stable", playbook_yml: "imt-re6stnet.yml", script_path: "install/imt/re6st"}
- { role: "install-script", playbook_yml: "test-suite.yml", script_path: "install/test-suite"} - { role: "install-script", channel: "stable", playbook_yml: "test-suite.yml", script_path: "install/test-suite"}
- { role: "install-script", channel: "unstable", playbook_yml: "slapos.yml", script_path: "install/unstable/slapos" }
- { role: "install-script", channel: "unstable", playbook_yml: "re6stnet.yml", script_path: "install/unstable/re6st"}
- { role: "install-script", channel: "unstable", playbook_yml: "vifib.yml", script_path: "install/unstable/vifib"}
- { role: "install-script", channel: "unstable", playbook_yml: "vifib-shuttle.yml", script_path: "install/unstable/vifib-shuttle"}
- { role: "install-script", channel: "unstable", playbook_yml: "erp5-standalone.yml", script_path: "install/unstable/erp5-standalone"}
- { role: "install-script", channel: "unstable", playbook_yml: "wendelin-standalone.yml", script_path: "install/unstable/wendelin-standalone"}
- { role: "install-script", channel: "unstable", playbook_yml: "slapos-test-node.yml", script_path: "install/unstable/slapos-test-node"}
- { role: "install-script", channel: "unstable", playbook_yml: "gnet-re6stnet.yml", script_path: "install/unstable/gnet/re6st"}
- { role: "install-script", channel: "unstable", playbook_yml: "gnet-server.yml", script_path: "install/unstable/gnet/slapos"}
- { role: "install-script", channel: "unstable", playbook_yml: "imt-server-update.yml", script_path: "install/unstable/imt/slapos-update"}
- { role: "install-script", channel: "unstable", playbook_yml: "imt-server.yml", script_path: "install/unstable/imt/slapos"}
- { role: "install-script", channel: "unstable", playbook_yml: "imt-vm-bootstrap.yml", script_path: "install/unstable/imt/vm-bootstrap"}
- { role: "install-script", channel: "unstable", playbook_yml: "imt-vm-bootstrap.yml", script_path: "install/imt-dev-bootstrap"}
- { role: "install-script", channel: "unstable", playbook_yml: "imt-vm-cloudera-manager.yml", script_path: "install/unstable/imt/vm-cloudera-manager"}
- { role: "install-script", channel: "unstable", playbook_yml: "imt-re6stnet.yml", script_path: "install/unstable/imt/re6st"}
- { role: "install-script", channel: "unstable", playbook_yml: "test-suite.yml", script_path: "install/unstable/test-suite"}
--- ---
- name: generate scripts - name: generate scripts
template: src=install.j2 dest={{ base_path }}/{{ script_path }} mode=0666 template: src=install.j2 dest={{ base_path }}/{{ script_path }} mode=0666
when: channel == "stable"
- name: generate scripts
template: src=install_unstable.j2 dest={{ base_path }}/{{ script_path }} mode=0666
when: channel == "unstable"
- name: Set ansible playbook on scripts - name: Set ansible playbook on scripts
lineinfile: dest={{ base_path }}/{{ script_path }} line="ansible-playbook {{ playbook_yml }} -i hosts --connection=local" state=present lineinfile: dest={{ base_path }}/{{ script_path }} line="ansible-playbook {{ playbook_yml }} -i hosts --connection=local" state=present
#!/bin/bash
set -e
#### Setup Ansible and load few libraries #####
BASE_SETUP_SCRIPT_MD5={{ base_setup.stat.md5 }}
type wget >/dev/null 2>&1 || { echo >&2 "I require wget but it's not installed. Aborting."; exit 1; }
wget --no-check-certificate https://deploy.erp5.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
# Include Additional Functions
if [ ! -f /etc/opt/slapcache.cfg ]; then
slapcache-conf
fi
sed -i "s/key = slapos-global-key/key = slapos-global-unstable-key/g" /etc/opt/slapcache.cfg
DFILE="/tmp/tmpplaybook_unstable$(basename $0).$$/"
TFILE="archive.tar.gz"
mkdir -p $DFILE
cd $DFILE
slapcache-download --destination=$TFILE
tar -xzvf $TFILE
rm $TFILE
clear
echo "Starting Ansible playbook:"
---
- name: Check if configuration exists already - name: Check if configuration exists already
stat: path=/etc/re6stnet/re6stnet.conf stat: path=/etc/re6stnet/re6stnet.conf
register: re6stnet_conf register: re6stnet_conf
...@@ -6,6 +7,10 @@ ...@@ -6,6 +7,10 @@
shell: "re6st-conf --registry {{ re6st_registry_url }} --token {{ re6sttoken }} -r title {{ computer_name }} -d /etc/re6stnet" shell: "re6st-conf --registry {{ re6st_registry_url }} --token {{ re6sttoken }} -r title {{ computer_name }} -d /etc/re6stnet"
when: re6stnet_conf.stat.exists == False and "{{ re6sttoken }}" != "notoken" and "{{ computer_name }}" != "noname" when: re6stnet_conf.stat.exists == False and "{{ re6sttoken }}" != "notoken" and "{{ computer_name }}" != "noname"
- name: Check if configuration exists already
stat: path=/etc/re6stnet/re6stnet.conf
register: recheck_re6stnet_conf
- name: Start re6st-node service - name: Start re6st-node service
service: name=re6st-node state=started enabled=yes service: name=re6st-node state=started enabled=yes
when: re6stnet_conf.stat.exists == True when: recheck_re6stnet_conf.stat.exists == True
\ No newline at end of file
---
- name: Install Debian 8 repository key - name: Install Debian 8 repository key
apt_key: url={{ base_open_build_url }}/Debian_8.0/Release.key state=present apt_key: url={{ base_open_build_url }}/Debian_8.0/Release.key state=present
when: ansible_distribution == "Debian" and ansible_distribution_major_version == "8" when: ansible_distribution == "Debian" and ansible_distribution_major_version == "8"
...@@ -36,5 +36,13 @@ ...@@ -36,5 +36,13 @@
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7" when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"
- name: Install CentOS 7 RPM Key - name: Install CentOS 7 RPM Key
rpm_key: state=present key=http://download.opensuse.org/repositories/home:/VIFIBnexedi/CentOS_CentOS-6/repodata/repomd.xml.key rpm_key: state=present key=http://download.opensuse.org/repositories/home:/VIFIBnexedi/CentOS_7/repodata/repomd.xml.key
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7" when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "7"
- name: Install CentOS 6 Repository
get_url: url=http://download.opensuse.org/repositories/home:/VIFIBnexedi/CentOS_CentOS-6/home:VIFIBnexedi.repo dest=/etc/yum.repos.d/slapos.repo mode=0440
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "6"
- name: Install CentOS 6 RPM Key
rpm_key: state=present key=http://download.opensuse.org/repositories/home:/VIFIBnexedi/CentOS_CentOS-6/repodata/repomd.xml.key
when: ansible_distribution == "CentOS" and ansible_distribution_major_version == "6"
\ No newline at end of file
import json
software_url = '{{ software_release_url }}' software_url = '{{ software_release_url }}'
# Choose a SlapOS Node
# If you are deploying SlapOS Master with Webrunner, then computer_id is 'slaprunner'
computer_id = 'local_computer' computer_id = 'local_computer'
supply(software_url, computer_id)
parameter_dict = {
"timezone": "UTC",
"site-id": "erp5",
"bt5": "erp5_full_text_myisam_catalog erp5_configurator_standard erp5_wendelin_configurator",
"developer-list": ["zope"],
"inituser-login": "zope",
"inituser-password": "insecure",
"zope-partition-dict": {
"admin": {
"family": "admin",
"thread-amount": 4,
"port-base": 2220,
"instance-count": 1
},
"activities-node": {
"family": "activities",
"thread-amount": 4,
"instance-count": 1,
"timerserver-interval": 1,
"port-base": 2230
},
"distribution-node": {
"family": "distribution",
"thread-amount": 1,
"instance-count": 1,
"port-base": 2210,
"timerserver-interval": 1
}
}
}
# Choose a title # Choose a title
title = "instance-of-{{ playbook_name }}" title = "instance-of-{{ playbook_name }}"
supply(software_url, computer_id)
request(software_url, request(software_url,
title, title,
filter_kw={'computer_guid': computer_id}, filter_kw={'computer_guid': computer_id},
software_type='default', software_type='create-erp5-site',
partition_parameter_kw={} partition_parameter_kw={
'_': json.dumps(parameter_dict, sort_keys=True, indent=2),
}
) )
...@@ -4,7 +4,7 @@ import sys ...@@ -4,7 +4,7 @@ import sys
print sys.argv[1:] print sys.argv[1:]
host_content = open('/etc/hosts', 'r').readlines() host_content = open('/etc/hosts', 'r').read()
hpath = sys.argv[1] hpath = sys.argv[1]
domain = sys.argv[2] domain = sys.argv[2]
lines_entry = "" lines_entry = ""
......
...@@ -8,6 +8,12 @@ ...@@ -8,6 +8,12 @@
job="bash -lc /usr/local/bin/vm-bootstrap-update >> /var/log/vm-bootstrap.log" job="bash -lc /usr/local/bin/vm-bootstrap-update >> /var/log/vm-bootstrap.log"
cron_file=ansible-vm-bootstrap user="root" cron_file=ansible-vm-bootstrap user="root"
- name: Add on reboot update on the VM
cron: name="reboot run vm bootstrap"
special_time=reboot
job="bash -lc /usr/local/bin/vm-bootstrap-update >> /var/log/vm-bootstrap.log"
cron_file=ansible-vm-bootstrap user="root"
- name: Check if /opt/slapos.playbook already exists - name: Check if /opt/slapos.playbook already exists
file: path=/opt/slapos.playbook/ state=directory file: path=/opt/slapos.playbook/ state=directory
......
--- ---
re6st_registry_url: http://re6stnet.imt.vifib.com/ re6st_registry_url: http://slapos.tl.teralab-datascience.fr:8088/
slapos_master_url: https://slap.tl.teralab-datascience.fr/ slapos_master_url: https://slap.imt.vifib.com/
slapos_web_master_url: https://slapos.tl.teralab-datascience.fr/ slapos_web_master_url: https://slapos.tl.teralab-datascience.fr/
interface_name: lo interface_name: lo
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
connection: local connection: local
vars: vars:
software_release_url: https://lab.nexedi.cn/nexedi/slapos/raw/1.0.3/software/wendelin/software.cfg software_release_url: https://lab.node.vifib.com/nexedi/slapos/raw/1.0.12/software/wendelin/software.cfg
startup_playbook_id: wendelin-standalone.yml startup_playbook_id: wendelin-standalone.yml
playbook_name: wendelin playbook_name: wendelin
request_instance_template: request-wendelin.j2 request_instance_template: request-wendelin.j2
......
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