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

Enables logging to syslog if openvpn_log_file is not set #181

Merged
merged 1 commit into from
Dec 22, 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
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ These options change how OpenVPN itself works.
| openvpn_client_config_dir | string | | ccd | Path of `client-config-dir` |
| openvpn_client_configs | dict | | {} | Dict of settings custom client configs |

## Logrotate
## Logrotate/Syslog
Set your own custom logrotate options
| Variable | Type | Choices | Default | Comment |
|--------------------------|--------|---------|-------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|
| openvpn_log_dir | string | | /var/log | Set location of openvpn log files. This parameter is a part of `log-append` configuration value. |
| openvpn_log_file | string | | openvpn.log | Set log filename. This parameter is a part of `log-append` configuration value. |
| openvpn_logrotate_config | string | | rotate 4<br />weekly<br />missingok<br />notifempty<br />sharedscripts<br />copytruncate<br />delaycompress | Configure logrotate script. |
| Variable | Type | Choices | Default | Comment |
|--------------------------|--------|---------|-------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|
| openvpn_log_dir | string | | /var/log | Set location of openvpn log files. This parameter is a part of `log-append` configuration value. |
| openvpn_log_file | string | | openvpn.log | Set log filename. This parameter is a part of `log-append` configuration value. If empty, syslog is used. |
| openvpn_logrotate_config | string | | rotate 4<br />weekly<br />missingok<br />notifempty<br />sharedscripts<br />copytruncate<br />delaycompress | Configure logrotate script. |

## Packaging
This role pulls in a bunch of different packages. Override the names as necessary.
Expand Down
5 changes: 5 additions & 0 deletions templates/server.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ group {{ openvpn_service_group }}

status status-{{ openvpn_config_file }}.log
status-version {{ openvpn_status_version }}

{% if openvpn_log_file is defined %}
log-append {{ openvpn_log_dir }}/{{ openvpn_log_file }}
{% else %}
syslog openvpn
{% endif %}
verb 3

{% if openvpn_verify_cn|bool %}
Expand Down
Loading