Commit 1e75f6b9 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

Add new scenario for vifib without re6st

This will be useful to setup machines where we already have IPv6 (for example, VM with IPv6 coming from the host).

/cc @alain.takoudjou @guillaume.hervier @rafael

/reviewed-on nexedi/slapos.package!81
parents 50da7401 fa252667
......@@ -19,5 +19,6 @@
default: "notoken"
roles:
- { role: re6stnet, package_state: present }
- { role: re6stnet-install }
- { role: re6stnet-ensure-running }
......@@ -15,5 +15,6 @@
default: "noname"
roles:
- { role: re6stnet, package_state: present }
- { role: re6stnet-install }
- { role: re6stnet-ensure-running }
- rina
- name: Install packages using apt
- name: Install {{ package_name }} using apt
apt: name={{ package_name }} state={{ package_state }} update_cache=yes cache_valid_time=3600
when: ansible_os_family == "Debian" or ansible_os_family == "Linuxmint"
- name: Install re6stnet on CentOS
- name: Install {{ package_name }} using yum
yum: name={{ package_name }} state={{ package_state }} update_cache=yes
when: ansible_os_family == "RedHat"
- name: Check if ip6tables check script is present
stat: path=/usr/bin/re6stnet-ip6tables-check
register: ip6tables_check
- name: Run re6stnet-ip6tables-check
shell: /usr/bin/re6stnet-ip6tables-check
when: ip6tables_check.stat.exists == True
- name: Check if configuration already exists
stat: path=/etc/re6stnet/re6stnet.conf
register: check_re6stnet_conf
- name: Start re6st-node service
service: name=re6stnet state=started enabled=yes
when: check_re6stnet_conf.stat.exists == True
---
- name: Check if configuration exists already
- name: Check if configuration already exists
stat: path=/etc/re6stnet/re6stnet.conf
register: re6stnet_conf
......@@ -25,7 +25,7 @@
shell: "re6st-conf --registry {{ re6st_registry_url }} --token {{ re6sttoken }} -r title {{ re6sttoken }} -d /etc/re6stnet"
when: re6st_annon == False and re6stnet_conf.stat.exists == False and "{{ re6sttoken }}" != "notoken" and "{{ re6st_fingerprint }}" == "nofingerprint"
- name: Check if configuration exists already
- name: Recheck if configuration already exists (after running re6st-conf)
stat: path=/etc/re6stnet/re6stnet.conf
register: recheck_re6stnet_conf
......@@ -50,14 +50,8 @@
- name: Add script for check ip6tables well configured
copy: src=ip6tables dest=/usr/bin/re6stnet-ip6tables-check mode=755
- name: Run re6stnet-ip6tables-check
shell: /usr/bin/re6stnet-ip6tables-check
- name: Include re6stnet-ip6tables-check at reboot on cron
cron: name="ip6tables at reboot" special_time=reboot job="sleep 20 && /usr/bin/re6stnet-ip6tables-check"
- include: tcp_nodelay.yml
- name: Start re6st-node service
service: name=re6stnet state=started enabled=yes
when: recheck_re6stnet_conf.stat.exists == True
- name: Install packages using apt
- name: Install slapos.node using apt
apt: name=slapos-node state={{ package_state }} update_cache=yes cache_valid_time=3600
when: ansible_os_family == "Debian"
- name: Install re6stnet on CentOS
- name: Install slapos.node using yum
yum: name=slapos.node state={{ package_state }} update_cache=yes
when: ansible_os_family == "RedHat"
......
......@@ -43,6 +43,7 @@
- name: Update playbook md5
shell: echo {{ archive.stat.md5 }} > /opt/upgrader/next-upgrade-signature
when: not ansible_check_mode
- name: Stat Current Upgrade Signature
file: path=/opt/upgrader/current-upgrade-signature state=touch mode="0666"
......@@ -59,7 +60,7 @@
- name: Do upgrade
shell: ansible-playbook {{ upgrader_playbook }} -i hosts 2>>/opt/upgrader/latest_upgrade.log >> /opt/upgrader/latest_upgrade.log
when: (upgrade_after > lookup('file', '/opt/upgrader/last-upgrade')|int ) and (lookup('file', '/opt/upgrader/next-upgrade-signature') != lookup('file', '/opt/upgrader/current-upgrade-signature'))
when: not ansible_check_mode and (upgrade_after > lookup('file', '/opt/upgrader/last-upgrade')|int ) and (lookup('file', '/opt/upgrader/next-upgrade-signature') != lookup('file', '/opt/upgrader/current-upgrade-signature'))
args:
chdir: /opt/upgrader/playbook-tmp/
......@@ -72,9 +73,9 @@
- name: Upgrade Current Upgrade Signature
shell: cat /opt/upgrader/next-upgrade-signature > /opt/upgrader/current-upgrade-signature
when: (upgrade_after > lookup('file', '/opt/upgrader/last-upgrade')|int ) and (lookup('file', '/opt/upgrader/next-upgrade-signature') != lookup('file', '/opt/upgrader/current-upgrade-signature'))
when: not ansible_check_mode and (upgrade_after > lookup('file', '/opt/upgrader/last-upgrade')|int ) and (lookup('file', '/opt/upgrader/next-upgrade-signature') != lookup('file', '/opt/upgrader/current-upgrade-signature'))
- shell: echo {{ ansible_date_time.epoch }} > /opt/upgrader/last-upgrade
when: (upgrade_after > lookup('file', '/opt/upgrader/last-upgrade')|int )
when: not ansible_check_mode and (upgrade_after > lookup('file', '/opt/upgrader/last-upgrade')|int )
- include: remove-legacy.yml
......@@ -23,22 +23,6 @@
- include: kvm.yml
- include: shuttle-modprobe.yml
- name: Check if re6stnet is configured
stat: path=/etc/re6stnet/re6stnet.conf
register: re6stnet_conf
- name: Check if ip6tables check script is present
stat: path=/usr/bin/re6stnet-ip6tables-check
register: ip6tables_check
- name: Run re6stnet-ip6tables-check
shell: /usr/bin/re6stnet-ip6tables-check
when: ip6tables_check.stat.exists == True
- name: Start re6st-node service if not started
service: name=re6stnet state=started enabled=yes
when: re6stnet_conf.stat.exists == True
- name: Increase ulimit
shell: echo "TODO"
......@@ -48,6 +32,7 @@
- name: Get systemd version
shell: systemd --version | head -n 1 | cut -d " " -f 2
register: systemd_version
check_mode: no
- file: state=directory path="/etc/systemd/system/cron.service.d/"
when: systemd_version.stdout | int > 228
......
......@@ -13,7 +13,7 @@ dependencies:
- { role: package, package_name: slapos-node, package_state: latest }
- { role: package, package_name: re6st-node, package_state: latest }
- { role: package, package_name: apt, package_state: latest }
- { role: re6stnet }
- { role: re6stnet-ensure-running }
- { role: etckeeper }
- { role: vifib-team-ssh-key }
- { role: vifib-server }
......
......@@ -13,7 +13,7 @@
- settings/slapos-master.yml
roles:
- { role: re6stnet, package_state: present }
- { role: re6stnet-install }
- { role: slapos, package_state: present }
- { role: package, package_name: ntp, package_state: present }
- vifib-team-ssh-key
......
......@@ -10,10 +10,11 @@
vars_prompt:
- name: "computer_name"
prompt: "Please insert your email or a name of this computer:"
prompt: "Please insert your email or a name of this computer, it will be used to configure re6st:"
private: no
default: "noname"
roles:
- { role: re6stnet, package_state: present }
- { role: re6stnet-install }
- { role: re6stnet-ensure-running }
......@@ -22,9 +22,8 @@
default: "notoken"
roles:
- { role: re6stnet, package_state: present }
- { role: slapos, package_state: present }
- { role: package, package_name: ntp, package_state: present }
- vifib-team-ssh-key
- vifib-shuttle
- upgrader
- vifib-server
......@@ -22,7 +22,7 @@
default: "notoken"
roles:
- { role: re6stnet, package_state: present }
- { role: re6stnet-install, package_state: present }
- { role: slapos, package_state: present }
- { role: package, package_name: ntp, package_state: present }
- vifib-team-ssh-key
......
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