Merge pull request #18574 from ericsagnes/feat/mongodb

MongoDB service: switch configuration format to YAML
This commit is contained in:
Domen Kožar 2016-09-21 14:19:17 +02:00 committed by GitHub
commit 001d314e87
3 changed files with 14 additions and 11 deletions

View file

@ -106,6 +106,11 @@ following incompatible changes:</para>
tool introduced to generate Go package definition from its Go source automatically.</para>
</listitem>
<listitem>
<para><literal>services.mongodb.extraConfig</literal> configuration format
was changed to YAML.</para>
</listitem>
</itemizedlist>

View file

@ -12,13 +12,11 @@ let
mongoCnf = pkgs.writeText "mongodb.conf"
''
bind_ip = ${cfg.bind_ip}
${optionalString cfg.quiet "quiet = true"}
dbpath = ${cfg.dbpath}
syslog = true
fork = true
pidfilepath = ${cfg.pidFile}
${optionalString (cfg.replSetName != "") "replSet = ${cfg.replSetName}"}
net.bindIp: ${cfg.bind_ip}
${optionalString cfg.quiet "systemLog.quiet: true"}
systemLog.destination: syslog
storage.dbPath: ${cfg.dbpath}
${optionalString (cfg.replSetName != "") "replication.replSetName: ${cfg.replSetName}"}
${cfg.extraConfig}
'';
@ -84,9 +82,9 @@ in
extraConfig = mkOption {
default = "";
example = ''
nojournal = true
storage.journal.enabled: false
'';
description = "MongoDB extra configuration";
description = "MongoDB extra configuration in YAML format";
};
};
@ -112,7 +110,7 @@ in
after = [ "network.target" ];
serviceConfig = {
ExecStart = "${mongodb}/bin/mongod --quiet --config ${mongoCnf}";
ExecStart = "${mongodb}/bin/mongod --quiet --config ${mongoCnf} --fork --pidfilepath ${cfg.pidFile}";
User = cfg.user;
PIDFile = cfg.pidFile;
Type = "forking";

View file

@ -77,7 +77,7 @@ in {
}; };
mongodb.enable = true;
mongodb.extraConfig = ''
nojournal = true
storage.journal.enabled: false
'';
};
systemd.services.mongodb.unitConfig.Before = "pump.io.service";