mirror of
https://git.fsfe.org/fsfe-system-hackers/innernet-playbook.git
synced 2024-12-03 03:53:11 +01:00
54 lines
1.3 KiB
YAML
54 lines
1.3 KiB
YAML
# SPDX-FileCopyrightText: 2021 Free Software Foundation Europe <https://fsfe.org>
|
|
#
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
---
|
|
- name: Install needed packages
|
|
tags: [update]
|
|
apt:
|
|
package:
|
|
- rsync
|
|
- wireguard
|
|
- wireguard-tools
|
|
|
|
- name: Copy package to host
|
|
tags: [update]
|
|
synchronize:
|
|
src: "innernet.deb"
|
|
dest: "/tmp/innernet.deb"
|
|
|
|
- name: Install package
|
|
tags: [update]
|
|
apt:
|
|
deb: "/tmp/innernet.deb"
|
|
update_cache: true
|
|
install_recommends: true
|
|
|
|
- name: Copy non-admin invitation to hosts
|
|
synchronize:
|
|
src: "{{ item.name }}.toml"
|
|
dest: "/tmp/{{ item.name }}.toml"
|
|
when:
|
|
# is not existing
|
|
- item.name not in hostvars['kaim.fsfeurope.org'].global_existing_peers.stdout_lines
|
|
# only if filename contains a part of the hostname
|
|
- item.name in ansible_host|replace('.', '-')
|
|
loop: "{{ peers }}"
|
|
|
|
- name: Install non-admin invitation on hosts
|
|
shell: |
|
|
innernet install /tmp/{{ item.name }}.toml \
|
|
--default-name \
|
|
--delete-invite
|
|
when:
|
|
# is not existing
|
|
- item.name not in hostvars['kaim.fsfeurope.org'].global_existing_peers.stdout_lines
|
|
# only if filename contains a part of the hostname
|
|
- item.name in ansible_host|replace('.', '-')
|
|
loop: "{{ peers }}"
|
|
|
|
- name: Enable innernet daemon
|
|
systemd:
|
|
name: "innernet@{{ network_name }}"
|
|
state: started
|