Skip to content

Commit

Permalink
Merge pull request #1 from Tina-pm/usr_bin
Browse files Browse the repository at this point in the history
Parametrise and update path to ip command
  • Loading branch information
NightTsarina authored Aug 21, 2024
2 parents 4923ac0 + e17b1b8 commit 3cecfbc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ tinc__vpn_extra_subnets:

# Install ferm service configuration file.
tinc__install_ferm_svc: false

# Command paths.
tinc__iproute2_path: /usr/bin/ip
2 changes: 1 addition & 1 deletion templates/subnet-down.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
echo "subnet-down for $NODE/$NETNAME" >&2

if [ "$NODE" != "$NAME" ]; then
/sbin/ip route del $SUBNET dev $INTERFACE
{{ tinc__iproute2_path }} route del $SUBNET dev $INTERFACE
fi
2 changes: 1 addition & 1 deletion templates/subnet-up.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
echo "subnet-up for $NODE/$NETNAME" >&2

if [ "$NODE" != "$NAME" ]; then
/sbin/ip route add $SUBNET dev $INTERFACE
{{ tinc__iproute2_path }} route add $SUBNET dev $INTERFACE
fi
4 changes: 2 additions & 2 deletions templates/tinc-down.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# {{ ansible_managed }}

{% for ADDR in tinc__vpn_addresses %}
/sbin/ip addr del dev {{ tinc__vpn_interface }} {{ ADDR }}
{{ tinc__iproute2_path }} addr del dev {{ tinc__vpn_interface }} {{ ADDR }}
{% endfor %}
/sbin/ip link set dev {{ tinc__vpn_interface }} down
{{ tinc__iproute2_path }} link set dev {{ tinc__vpn_interface }} down
4 changes: 2 additions & 2 deletions templates/tinc-up.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# {{ ansible_managed }}

/sbin/ip link set dev {{ tinc__vpn_interface }} up
{{ tinc__iproute2_path }} link set dev {{ tinc__vpn_interface }} up
{% for ADDR in tinc__vpn_addresses %}
/sbin/ip addr add dev {{ tinc__vpn_interface }} {{ ADDR }}
{{ tinc__iproute2_path }} addr add dev {{ tinc__vpn_interface }} {{ ADDR }}
{% endfor %}

0 comments on commit 3cecfbc

Please sign in to comment.