1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00

Update main.yml

This commit is contained in:
A Holt 2019-02-02 14:38:52 -05:00 committed by GitHub
parent e473f3af8e
commit 053874a45c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -86,9 +86,17 @@
# - "{{ downloads_dir }}/mongodb-3.0.1x/tools/*" # - "{{ downloads_dir }}/mongodb-3.0.1x/tools/*"
# when: internet_available and is_rpi # when: internet_available and is_rpi
- name: Create Linux group mongodb (rpi)
group:
name: mongodb
state: present
when: is_rpi
- name: Create Linux user mongodb (rpi) - name: Create Linux user mongodb (rpi)
user: user:
name: mongodb name: mongodb
group: mongodb # primary group
groups: mongodb
home: /var/lib/mongodb home: /var/lib/mongodb
shell: /usr/sbin/nologin shell: /usr/sbin/nologin
when: is_rpi when: is_rpi
@ -96,15 +104,17 @@
# 2. CONFIGURE FOR IIAB # 2. CONFIGURE FOR IIAB
- name: 'Create 3 dirs for MongoDB: /var/run/mongodb, {{ mongodb_db_path }}, /var/log/mongodb' - name: 'Create 3 dirs for MongoDB: /var/lib/mongodb, /var/log/mongodb, {{ mongodb_db_path }}'
file: file:
state: directory state: directory
path: "{{ item.path }}" path: "{{ item }}"
owner: mongodb owner: mongodb
group: mongodb
with_items: with_items:
- { path: '/var/run/mongodb' } #- { path: '/var/run/mongodb' }
- { path: "{{ mongodb_db_path }}" } # == /library/dbdata/mongodb/ - /var/lib/mongodb
- { path: '/var/log/mongodb' } - /var/log/mongodb
- "{{ mongodb_db_path }}" # i.e. /library/dbdata/mongodb/
- name: Install /etc/mongod.conf, mongodb.service, /usr/bin/iiab-mongodb-repair-if-no-lock from templates - name: Install /etc/mongod.conf, mongodb.service, /usr/bin/iiab-mongodb-repair-if-no-lock from templates
template: template:
@ -114,7 +124,7 @@
group: root group: root
mode: "{{ item.mode }}" mode: "{{ item.mode }}"
with_items: with_items:
- { src: 'mongod.conf.j2', dest: "{{ mongodb_conf }}", mode: '0644' } # /etc/mongod.conf - { src: 'mongod.conf.j2', dest: "{{ mongodb_conf }}", mode: '0644' } # i.e. /etc/mongod.conf
- { src: 'mongodb.service.j2', dest: '/etc/systemd/system/mongodb.service', mode: '0644' } - { 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' } - { src: 'iiab-mongodb-repair-if-no-lock.j2', dest: '/usr/bin/iiab-mongodb-repair-if-no-lock', mode: '0755' }
@ -132,6 +142,7 @@
- name: Disable 'mongodb' service, if not mongodb_enabled - name: Disable 'mongodb' service, if not mongodb_enabled
systemd: systemd:
name: mongodb name: mongodb
daemon_reload: yes
enabled: no enabled: no
state: stopped state: stopped
when: not mongodb_enabled when: not mongodb_enabled