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

MongoDB service: switch configuration format to YAML #18574

Merged
merged 2 commits into from
Sep 21, 2016
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
5 changes: 5 additions & 0 deletions nixos/doc/manual/release-notes/rl-1609.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>


Expand Down
18 changes: 8 additions & 10 deletions nixos/modules/services/databases/mongodb.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ let

mongoCnf = pkgs.writeText "mongodb.conf"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/.conf/.yaml/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upstream documentation uses .conf files.
Do you think we should change to .yaml anyway?

''
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}
'';

Expand Down Expand Up @@ -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";
};
};

Expand All @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/pump.io.nix
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ in {
}; };
mongodb.enable = true;
mongodb.extraConfig = ''
nojournal = true
storage.journal.enabled: false
'';
};
systemd.services.mongodb.unitConfig.Before = "pump.io.service";
Expand Down