add client role

This commit is contained in:
linus 2021-11-15 19:09:18 +01:00
parent 3f55038342
commit f06984cfb1
2 changed files with 39 additions and 0 deletions

BIN
roles/client/files/innernet Executable file

Binary file not shown.

View File

@ -0,0 +1,39 @@
# SPDX-FileCopyrightText: 2021 Free Software Foundation Europe <https://fsfe.org>
#
# 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 }}"