Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
fetched_creds
*.retry
/inventory
.DS_Store
playbooks/group_vars/all.yml
playbooks/group_vars/openvpn-vpn.yml
2 changes: 2 additions & 0 deletions inventory.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
[openvpn-internet]
# Typical Digital Ocean config w/ root user and pub/priv key authentication
#255.255.255.255 ansible_user=root
# Typical Amazon AWS Ubuntu config w/ sudo user ubuntu and pub/priv key authentication
#255.255.255.255 ansible_user=ubuntu ansible_become_user=root ansible_become=yes
# Typical azure config w/ ssh authentication
#255.255.255.255 ansible_user=vpnuser ansible_become=yes
# Config for a machine with pub/priv key and password
Expand Down
5 changes: 5 additions & 0 deletions playbooks/roles/openvpn/tasks/openvpn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
name: net.ipv4.ip_forward
value: 1

- name: OpenVPN | Configuration | Copy sshd service file into place
template:
src: sshd.service.j2
dest: "/lib/systemd/system/ssh.service"

- name: OpenVPN | Configuration | Copy OpenVPN server configuration files into place
template:
src: etc_openvpn_server.conf.j2
Expand Down
18 changes: 18 additions & 0 deletions playbooks/roles/openvpn/templates/sshd.service.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[Unit]
Description=OpenBSD Secure Shell server
Wants=sys-devices-virtual-net-tun-udp-1194.device
After=network.target auditd.service sys-devices-virtual-net-tun-udp-1194.device
ConditionPathExists=!/etc/ssh/sshd_not_to_be_run

[Service]
EnvironmentFile=-/etc/default/ssh
ExecStart=/usr/sbin/sshd -D $SSHD_OPTS
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartPreventExitStatus=255
Type=notify

[Install]
WantedBy=multi-user.target
Alias=sshd.service