Skip to content

Commit 7a64fd3

Browse files
author
Mickael Berkhout
committed
Added ssl config support in config template
1 parent 03a37b6 commit 7a64fd3

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

defaults/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ mongodb_net_http_enabled: false # Enable http interface
2525
mongodb_net_ipv6: false # Enable IPv6 support (disabled by default)
2626
mongodb_net_maxconns: 65536 # Max number of simultaneous connections
2727
mongodb_net_port: 27017 # Specify port number
28+
mongodb_net_ssl: disabled # Enable or disable ssl connections
29+
mongodb_net_ssl_mode: # Set the ssl mode (RequireSSL / PreferSSL / AllowSSL / disabled)
30+
mongodb_net_ssl_pemfile: # Location of the pemfile to use for ssl
2831

2932
## processManagement Options
3033
# Fork server process

templates/mongod.conf.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ net:
99
ipv6: {{ mongodb_net_ipv6 | to_nice_json }}
1010
maxIncomingConnections: {{ mongodb_net_maxconns }}
1111
port: {{ mongodb_net_port }}
12+
{% if mongodb_net_ssl_pemfile is defined and mongodb_net_ssl_mode is defined and mongodb_net_ssl == 'enabled' -%}
13+
ssl:
14+
mode: {{ mongodb_net_ssl_mode }}
15+
PEMKeyFile: {{ mongodb_net_ssl_pemfile }}.pem
16+
{% endif %}
1217

1318
processManagement:
1419
fork: {{ mongodb_processmanagement_fork | to_nice_json}}

0 commit comments

Comments
 (0)