fixup! interconnect servers through the ekumen

This commit is contained in:
f 2022-06-19 14:25:04 -03:00
parent 3346eed1c7
commit 93787bcad1

34
tasks/ekumen.yml Normal file
View file

@ -0,0 +1,34 @@
---
- name: "Clone ekumen repository locally."
git:
repo: "git@0xacab.org:sutty/ecumen.git"
dest: "./ekumen"
version: "ekumen"
delegate_to: "localhost"
- name: "Init node."
shell: "./ekumen/ekumen init -a {{ hostvars[inventory_hostname].ansible_default_ipv4.address }} -p 65000 {{ ekumen }}"
delegate_to: "localhost"
args:
creates: "./ekumen/networks/ekumen/hosts/{{ ekumen }}"
- name: "Inter-connect nodes."
when: "ekumen != hostvars[item].ekumen"
shell: "./ekumen/ekumen connectto {{ ekumen }} {{ hostvars[item].ekumen }}"
delegate_to: "localhost"
args:
creates: "./ekumen/networks/ekumen/{{ ekumen }}/hosts/{{ hostvars[item].ekumen }}"
with_items: "{{ ansible_play_hosts }}"
- name: "Create /etc/tinc."
file:
state: "directory"
dest: "/etc/tinc"
- name: "Upload configurations."
synchronize:
delete: true
dest: "/etc/tinc/ekumen/"
src: "./ekumen/networks/ekumen/{{ ekumen }}/"
- name: "Enable ekumen."
shell: "rc-update add tincd"
args:
creates: "/etc/runlevels/default/tincd"
- name: "Start ekumen."
shell: "/etc/init.d/tincd start"