From 1d99288dab3f31ccf87fd1a998e31affd7beabb4 Mon Sep 17 00:00:00 2001 From: Dan LaManna Date: Fri, 2 Sep 2016 18:49:48 -0400 Subject: [PATCH 1/2] Add mongod unit file for systemd --- files/mongod.service | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 files/mongod.service diff --git a/files/mongod.service b/files/mongod.service new file mode 100644 index 0000000..66ebce2 --- /dev/null +++ b/files/mongod.service @@ -0,0 +1,10 @@ +[Unit] +Description=High-performance, schema-free document-oriented database +After=network.target + +[Service] +User=mongodb +ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf + +[Install] +WantedBy=multi-user.target From cac9cb60105b4eac2d99942e391f3aaeb027ff47 Mon Sep 17 00:00:00 2001 From: Dan LaManna Date: Fri, 2 Sep 2016 18:50:51 -0400 Subject: [PATCH 2/2] Add support for systemd service in Ubuntu Xenial --- tasks/install.xenial.yml | 4 ++++ tasks/mongodb.yml | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 tasks/install.xenial.yml diff --git a/tasks/install.xenial.yml b/tasks/install.xenial.yml new file mode 100644 index 0000000..55716f0 --- /dev/null +++ b/tasks/install.xenial.yml @@ -0,0 +1,4 @@ +- name: install systemd service + copy: + src=mongod.service + dest=/etc/systemd/system/mongod.service diff --git a/tasks/mongodb.yml b/tasks/mongodb.yml index eacea05..dca8a7e 100644 --- a/tasks/mongodb.yml +++ b/tasks/mongodb.yml @@ -13,6 +13,9 @@ - include: install.deb.yml when: ansible_os_family == 'Debian' and mongodb_install +- include: install.xenial.yml + when: ansible_os_family == 'Debian' and ansible_distribution_release == 'xenial' + - include: configure.yml when: mongodb_install