2022-03-03 10:58:48 +01:00
|
|
|
# SPDX-FileCopyrightText: 2021 Free Software Foundation Europe <https://fsfe.org>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
---
|
|
|
|
- name: Add innernet peer on server
|
|
|
|
shell: |
|
|
|
|
innernet-server add-peer "{{ network_name }}" \
|
|
|
|
--name "{{ peer_name }}" \
|
|
|
|
--cidr "{{ peer_cidr }}" \
|
|
|
|
--admin "{{ peer_admin | lower }}" \
|
|
|
|
--save-config "/root/{{ peer_name }}.toml" \
|
|
|
|
--invite-expires "14d" \
|
|
|
|
--auto-ip \
|
|
|
|
--yes
|
|
|
|
|
|
|
|
- name: Copy peer invitation file from server to controller
|
|
|
|
fetch:
|
|
|
|
src: "/root/{{ peer_name }}.toml"
|
|
|
|
dest: "{{ playbook_dir }}/roles/client/files/{{ peer_name }}.toml"
|
|
|
|
flat: yes
|
|
|
|
fail_on_missing: yes
|
|
|
|
|
|
|
|
- name: Delete peer invitation file on server
|
|
|
|
file:
|
|
|
|
state: absent
|
|
|
|
path: "/root/{{ peer_name }}.toml"
|
2022-03-03 11:51:54 +01:00
|
|
|
|
|
|
|
- name: Inform about invitation file
|
|
|
|
debug:
|
|
|
|
msg: "
|
|
|
|
{% if manual is defined and manual %}
|
|
|
|
ATTENTION! Now you have to install the peer invitation file for
|
|
|
|
{{ peer_name }} manually. You will find it here:
|
|
|
|
{% else %}
|
|
|
|
The peer invitation file has been downloaded to your computer. It will
|
|
|
|
be installed automatically on the machine, so if everything succeeded,
|
|
|
|
you can safely delete it here.
|
|
|
|
{% endif %}
|
|
|
|
{{ playbook_dir }}/roles/client/files/{{ peer_name }}.toml
|
|
|
|
"
|