innernet-playbook/roles/client/tasks/main.yml

40 lines
904 B
YAML
Raw Normal View History

2021-11-15 19:09:18 +01:00
# 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 }}"