Skip to content

Commit 9d0f8c4

Browse files
authored
Updating mongodb.conf template to make it work on RedHat derivatives as well (#168)
* Updating mongodb.conf template to work with CentOS * Applying recommeded mongodb thread configuration for RedHat derivatives * Fix failing mongodb test on ubuntu 20.04
1 parent aa23893 commit 9d0f8c4

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

molecule/default/tests/test_default.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@ def test_service_elasticsearch_running(host):
33
assert host.service("elasticsearch").is_running is True
44

55
def test_service_mongodb_running(host):
6-
if host.system_info.distribution == 'ubuntu' and host.system_info.codename == 'focal':
7-
mongodb_service_name = 'mongodb'
8-
else:
9-
mongodb_service_name = 'mongod'
10-
11-
assert host.service(mongodb_service_name).is_running is True
6+
assert host.service("mongod").is_running is True
127

138
def test_is_graylog_installed(host):
149
assert host.package('graylog-server').is_installed

templates/mongodb.conf.j2

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@ net:
2323
bindIp: {{ graylog_mongodb_bind_ip }}
2424

2525

26-
{% if ansible_distribution != "RedHat" %}
2726
processManagement:
27+
{% if ansible_os_family != "RedHat" %}
2828
fork: false
29+
{% else %}
30+
fork: true # fork and run in background
31+
pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile
32+
timeZoneInfo: /usr/share/zoneinfo
2933
{% endif %}
3034

3135
#security:

0 commit comments

Comments
 (0)