Closed marcin-github closed 4 years ago
And... why is used custom unit to start mongod?
When the service file template is copied over, it calls a handler to restart systemd:
https://github.com/Graylog2/graylog-ansible-role/blob/master/tasks/mongodb-RedHat.yml#L33 https://github.com/Graylog2/graylog-ansible-role/blob/master/handlers/main.yml#L3-L5
So, it should be doing that.
I'm not sure about the custom service file. Looking through the commit history, it looks like it was to fix an issue with MongoDB not starting when SELinux is enabled (See: https://github.com/Graylog2/graylog-ansible-role/pull/87).
Because ansible uses own system unit for mongod it is needed to run
systemctl daemon-reload
before start mongod.