forked from linux/documentation
43 lines
1.1 KiB
Markdown
43 lines
1.1 KiB
Markdown
# VPN with Cisco Secure Client
|
|
|
|
## Installation
|
|
|
|
In Hierea you can enable it with
|
|
|
|
```
|
|
cisco_vpn::enable: true
|
|
```
|
|
|
|
|
|
## Automatic Actions upon Connect
|
|
|
|
If you want to run a script after activation of the VPN connection best use the NetworkManager dispatcher service by placing into `/etc/NetworkManager/dispatcher.d/` a script like
|
|
|
|
```
|
|
#!/usr/bin/bash
|
|
|
|
set -o errexit # abort on nonzero exitstatus
|
|
set -o nounset # abort on unbound variable
|
|
set -o pipefail # do not hide errors within pipes
|
|
shopt -u failglob # abort if there is no wildcard match
|
|
|
|
INTERFACE="$1"
|
|
EVENT="$2"
|
|
|
|
if [[ $EVENT == up ]] && [[ $INTERFACE =~ ^cscotun ]]; then
|
|
# give some time for all network configuration to happen
|
|
sleep 5
|
|
# security updates + Puppet run
|
|
systemctl start dnf-automatic
|
|
fi
|
|
```
|
|
which will install whatever is configured for dnf-automatic (by default security updates), followed by a Puppet run.
|
|
|
|
If you want a full update independent of `dnf-automatic`, then do
|
|
```
|
|
dnf --assumeyes update || true
|
|
puppet agent -t
|
|
```
|
|
|
|
Best place this script with [Hiera](../files/distribute_files).
|