Skip to content

Commit

Permalink
Respect POSIX capabilities / cap_net_admin
Browse files Browse the repository at this point in the history
If 'cap_net_admin' POSIX capability is not present, 'debops.tinc' will
not try and reconfigure VPN interface automatically; tincd will still be
configured but not restarted / reloaded.
  • Loading branch information
drybjed committed May 21, 2015
1 parent 0a4175c commit 8769788
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

- name: Reload tinc configuration
command: tincd -n {{ tinc_network }} -kHUP
when: (ansible_local|d() and ansible_local.cap12s|d() and
(not ansible_local.cap12s.enabled | bool or
(ansible_local.cap12s.enabled | bool and "cap_net_admin" in ansible_local.cap12s.list)))

- name: Restart tinc VPN connection
shell: test -d /run/systemd/system &&
( systemctl restart ifup@{{ tinc_interface }}.service ) ||
( ifdown {{ tinc_interface }} ; ifup {{ tinc_interface }} )
when: (ansible_local|d() and ansible_local.cap12s|d() and
(not ansible_local.cap12s.enabled | bool or
(ansible_local.cap12s.enabled | bool and "cap_net_admin" in ansible_local.cap12s.list)))

0 comments on commit 8769788

Please sign in to comment.