diff --git a/roles/client/files/innernet b/roles/client/files/innernet new file mode 100755 index 0000000..2c3ed50 Binary files /dev/null and b/roles/client/files/innernet differ diff --git a/roles/client/tasks/main.yml b/roles/client/tasks/main.yml new file mode 100644 index 0000000..da54543 --- /dev/null +++ b/roles/client/tasks/main.yml @@ -0,0 +1,39 @@ +# SPDX-FileCopyrightText: 2021 Free Software Foundation Europe +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +--- +- name: Install needed packages + apt: + package: + - rsync + - wireguard + - wireguard-tools + +- name: Copy binary to server (innernet) + synchronize: + src: "server" + dest: "/usr/bin/innernet" + +- name: Create alias ("inn") + lineinfile: + path: "/root/.bashrc" + line: '"alias inn="innernet"' + +- name: Copy non-admin invitation to servers + synchronize: + src: "{{ item.name }}.toml" + dest: "/home/root/{{ item.name }}.toml" + loop: "{{ peers }}" + when: + - item.cidr == "machines" + - item.name in "{{ ansible_host }}" + +- name: Install non-admin invitation on servers + shell: | + innernet install {{ item.name }}.toml \ + --yes + loop: "{{ peers }}" + when: + - item.cidr == "machines" + - item.name in "{{ ansible_host }}"