diff options
Diffstat (limited to 'playbooks.d/vpn-tinc/playbook.bash')
-rw-r--r-- | playbooks.d/vpn-tinc/playbook.bash | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/playbooks.d/vpn-tinc/playbook.bash b/playbooks.d/vpn-tinc/playbook.bash index b23371c..485c6e6 100644 --- a/playbooks.d/vpn-tinc/playbook.bash +++ b/playbooks.d/vpn-tinc/playbook.bash @@ -43,10 +43,6 @@ playbook_add() "$etc" \ "$etc/hosts" - file_template tinc.conf \ - "name=$host" \ - > "$etc/tinc.conf" - file_template "tinc-up-$iptool" \ "ip4=$ipv4" \ "ip6=$ipv6" \ @@ -142,6 +138,17 @@ playbook_sync() cp -v -- "$data/hosts/$file" "$etc/hosts/$file" done + info "$BASHTARD_PLAYBOOK/sync" "Reconfiguring peers" + { + printf "Name = %s\n\n" "$host" + + while read -r peer + do + printf "ConnectTo = %s\n" "$(config "$BASHTARD_PLAYBOOK.peers.$peer")" + done < <( config_subkeys "$BASHTARD_PLAYBOOK.peers" ) + } > "$etc/tinc.conf" + + [[ "$BASHTARD_COMMAND" == "add" ]] && return [[ "$hash" == "$(dir_hash "$etc/hosts")" ]] && return |