Commit 0791285c authored by Rafael Monnerat's avatar Rafael Monnerat

Include vm bootstrapping for re6st interface.

parent 6a51d914
......@@ -20,3 +20,4 @@ render("gnet-server.yml", "install/gnet/slapos")
# imt
render("imt-server-update.yml", "install/imt/slapos-update")
render("imt-server.yml", "install/imt/slapos")
render("imt-vm-bootstrap.yml", "install/imt/vm-bootstrap")
#!/bin/bash
PLAYBOOK_REPOSITORY_URL=https://lab.nexedi.cn/rafael/slapos.playbook/repository/archive.tar.gz?ref=master
PLAYBOOK_FILE=imt-vm-bootstrap.yml
#### Setup Ansible and load few libraries #####
BASE_SETUP_SCRIPT_MD5=836e9256decdf8e2cd49d388fa7851ab
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:
- vm-bootstrap
---
dependencies:
- { role: package, package_name: slapos-node, package_state: present }
- { 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 node register
shell: "slapos node register --token {{ slapostoken }} --master-url {{ slapos_master_url }} --master-url-web {{ slapos_web_master_url }} {{ computer_name }}"
shell: "slapos node register --token {{ slapostoken }} --master-url {{ slapos_master_url }} --master-url-web {{ slapos_web_master_url }} --interface-name lo {{ computer_name }}"
when: slapos_cfg.stat.exists == False and "{{ slapostoken }}" != "notoken" and "{{ computer_name }}" != "noname"
- name: Run slapos format for initial bootstrap
......
- name: Create /etc/opt dir
file: dest=/etc/opt mode=775 state=directory
- name: Download configuration
get_url: url=http://10.0.2.100/netconfig.sh dest=/etc/opt/netconfig.sh mode=755
- name: stat /etc/opt/netconfig.sh
stat: /etc/opt/netconfig.sh
register: netconfig_file
- name: replace /etc/rc.local
copy: src=/etc/opt/netconfig.sh dest=/etc/rc.local mode=755
when: netconfig_file.stat.exists == True
- name: call netconfig.sh
shell: /etc/opt/netconfig.sh
when: netconfig_file.stat.exists == True
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