diff --git a/tasks/main.yml b/tasks/main.yml index 0f4e1c8..2e4476d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -86,4 +86,4 @@ name: "tinc@{{ tinc_vpn_id }}" state: restarted enabled: yes - when: inventory_hostname != 'localhost' + when: ansible_os_family != 'Darwin' diff --git a/templates/tinc-down.j2 b/templates/tinc-down.j2 index 193fa8d..5693ccb 100644 --- a/templates/tinc-down.j2 +++ b/templates/tinc-down.j2 @@ -8,7 +8,7 @@ /sbin/ifconfig $INTERFACE down /bin/ip route del {{ tinc_remote_nets[0].net_cidr }} dev eth0 -{% elif ansible_hostname == 'Magrathea' %} +{% elif ansible_os_family == 'Darwin' %} /sbin/ifconfig $INTERFACE down /sbin/route -n delete -net {{ tinc_remote_nets[0].net_cidr }} {{ tinc_remote_nets[0].gateway }} diff --git a/templates/tinc-up.j2 b/templates/tinc-up.j2 index 8a2ea1f..29acac6 100644 --- a/templates/tinc-up.j2 +++ b/templates/tinc-up.j2 @@ -14,7 +14,7 @@ iptables -t nat -A POSTROUTING -o eth0 -s {{ tinc_vpn_net }} -j MASQUERADE -{% elif ansible_hostname == 'Magrathea' %} +{% elif ansible_os_family == 'Darwin' %} # only a single endpoint works, because tun interface is p2p /sbin/ifconfig tun0 inet {{ tinc_client_ip | ipaddr('address') }} {{ tinc_remote_nets[0].gateway }} up netmast 255.255.255.0