fixup! interconnect servers through the ekumen
This commit is contained in:
parent
3346eed1c7
commit
93787bcad1
1 changed files with 34 additions and 0 deletions
34
tasks/ekumen.yml
Normal file
34
tasks/ekumen.yml
Normal 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"
|
Loading…
Reference in a new issue