From 77044a2570d33013cf9575e221ad0ef7c56ef451 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 31 Oct 2018 02:51:34 -0400 Subject: [PATCH] Update main.yml --- roles/mongodb/tasks/main.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/roles/mongodb/tasks/main.yml b/roles/mongodb/tasks/main.yml index 65f124022..2029c6b2d 100644 --- a/roles/mongodb/tasks/main.yml +++ b/roles/mongodb/tasks/main.yml @@ -1,4 +1,4 @@ -- name: Install packages mongodb-server and mongodb +- name: 'Install packages: mongodb, mongodb-server' package: name: - mongodb-server @@ -8,7 +8,7 @@ tags: - download -- name: Create the data directory for MongoDB +- name: Create 3 dirs for MongoDB file: state: directory path: "{{ item.path }}" @@ -18,7 +18,7 @@ - { path: "{{ mongodb_db_path }}" } # == /library/dbdata/mongodb/ - { path: '/var/log/mongodb' } -- name: Populate & position /etc/mongod.conf, mongodb.service +- name: Populate & position /etc/mongod.conf, mongodb.service, /usr/bin/iiab-mongodb-repair-if-no-lock template: src: "{{ item.src }}" dest: "{{ item.dest }}" @@ -30,7 +30,7 @@ - { src: 'mongodb.service.j2', dest: '/etc/systemd/system/mongodb.service', mode: '0644' } - { src: 'iiab-mongodb-repair-if-no-lock.j2', dest: '/usr/bin/iiab-mongodb-repair-if-no-lock', mode: '0755' } -- name: Enable+restart systemd service if mongodb_enabled, with "systemctl daemon-reload" (in case mongodb.service changed?) +- name: Enable & Restart 'mongodb' systemd service if mongodb_enabled, incl daemon-reload (in case mongodb.service changed?) systemd: name: mongodb enabled: yes @@ -38,16 +38,16 @@ daemon_reload: yes when: mongodb_enabled -- name: 'Disable+stop systemd service if mongodb_enabled: False' +- name: Disable 'mongodb' service, if not mongodb_enabled systemd: name: mongodb enabled: no state: stopped when: not mongodb_enabled -- name: Add 'mongodb' to list of services at {{ iiab_ini_file }} +- name: Add 'mongodb' variable values to {{ iiab_ini_file }} ini_file: - dest: "{{ iiab_ini_file }}" + path: "{{ iiab_ini_file }}" section: mongodb option: "{{ item.option }}" value: "{{ item.value }}"