# 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 }}"