Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add systemd override for openvpn #209

Merged
merged 1 commit into from
Dec 25, 2024
Merged
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 files/openvpn-server-override.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Service]
ExecStart=
ExecStart=/usr/sbin/openvpn --config %i.conf
16 changes: 16 additions & 0 deletions tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,22 @@
state: absent
when: openvpn_client_config is falsy

- name: Create openvpn service override
when: ansible_service_mgr == "systemd"
block:
- name: Create openvpn service override directory
ansible.builtin.file:
path: /etc/systemd/system/openvpn-server@.service.d
state: directory
owner: root
group: root
mode: "0755"
- name: Copy openvpn service override file
ansible.builtin.copy:
src: openvpn-server-override.conf
dest: /etc/systemd/system/openvpn-server@.service.d/override.conf
mode: "0644"

- name: Setup openvpn auto-start & start
ansible.builtin.service:
name: "{{ openvpn_service_name }}"
Expand Down
Loading