refactoring
This commit is contained in:
parent
4d0aad3e1f
commit
e7df50e2a6
@ -16,6 +16,40 @@
|
|||||||
with_items:
|
with_items:
|
||||||
- mongodb-org
|
- mongodb-org
|
||||||
- python2-pip
|
- python2-pip
|
||||||
|
|
||||||
|
- name: Create group '{{ mongodb_system_group }}'
|
||||||
|
group:
|
||||||
|
name: "{{ mongodb_system_group }}"
|
||||||
|
gid: "{{ mongodb_system_gid | default(omit) }}"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Create user '{{ mongodb_system_user }}'
|
||||||
|
user:
|
||||||
|
name: "{{ mongodb_system_user }}"
|
||||||
|
uid: "{{ mongodb_system_uid | default(omit) }}"
|
||||||
|
group: "{{ mongodb_system_group }}"
|
||||||
|
|
||||||
|
- name: Create db storage dir '{{ mongodb_storage_dbpath }}'
|
||||||
|
file:
|
||||||
|
path: "{{ mongodb_storage_dbpath }}"
|
||||||
|
owner: "{{ mongodb_system_user }}"
|
||||||
|
group: "{{ mongodb_system_group }}"
|
||||||
|
selevel: s0
|
||||||
|
serole : object_r
|
||||||
|
setype: mongod_var_lib_t
|
||||||
|
seuser: system_u
|
||||||
|
state: directory
|
||||||
|
notify: __mongod_restart
|
||||||
|
|
||||||
|
- name: Create log dir '{{ mongodb_systemlog_path | dirname }}'
|
||||||
|
file:
|
||||||
|
path: "{{ mongodb_systemlog_path | dirname }}"
|
||||||
|
owner: "{{ mongodb_system_user }}"
|
||||||
|
group: "{{ mongodb_system_group }}"
|
||||||
|
recurse: yes
|
||||||
|
state: directory
|
||||||
|
when: mongodb_systemlog_destination == 'file'
|
||||||
|
notify: __mongod_restart
|
||||||
become: True
|
become: True
|
||||||
|
|
||||||
- name: Install pymongo as ansible dependency
|
- name: Install pymongo as ansible dependency
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
---
|
---
|
||||||
- include_tasks: prepare.yml
|
- include_tasks: install.yml
|
||||||
|
|
||||||
- include_tasks: storage.yml
|
- include_tasks: storage.yml
|
||||||
when: mongodb_lvm_enabled
|
when: mongodb_lvm_enabled
|
||||||
|
|
||||||
- include_tasks: install.yml
|
|
||||||
|
|
||||||
- include_tasks: confi.yml
|
- include_tasks: confi.yml
|
||||||
|
|
||||||
- name: Check where admin user already exists
|
- name: Check where admin user already exists
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
---
|
|
||||||
- block:
|
|
||||||
- name: Create group '{{ mongodb_system_group }}'
|
|
||||||
group:
|
|
||||||
name: "{{ mongodb_system_group }}"
|
|
||||||
gid: "{{ mongodb_system_gid | default(omit) }}"
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Create user '{{ mongodb_system_user }}'
|
|
||||||
user:
|
|
||||||
name: "{{ mongodb_system_user }}"
|
|
||||||
uid: "{{ mongodb_system_uid | default(omit) }}"
|
|
||||||
group: "{{ mongodb_system_group }}"
|
|
||||||
|
|
||||||
- name: Create db storage dir '{{ mongodb_storage_dbpath }}'
|
|
||||||
file:
|
|
||||||
path: "{{ mongodb_storage_dbpath }}"
|
|
||||||
owner: "{{ mongodb_system_user }}"
|
|
||||||
group: "{{ mongodb_system_group }}"
|
|
||||||
selevel: s0
|
|
||||||
serole : object_r
|
|
||||||
setype: mongod_var_lib_t
|
|
||||||
seuser: system_u
|
|
||||||
state: directory
|
|
||||||
notify: __mongod_restart
|
|
||||||
|
|
||||||
- name: Create log dir '{{ mongodb_systemlog_path | dirname }}'
|
|
||||||
file:
|
|
||||||
path: "{{ mongodb_systemlog_path | dirname }}"
|
|
||||||
owner: "{{ mongodb_system_user }}"
|
|
||||||
group: "{{ mongodb_system_group }}"
|
|
||||||
recurse: yes
|
|
||||||
state: directory
|
|
||||||
when: mongodb_systemlog_destination == 'file'
|
|
||||||
notify: __mongod_restart
|
|
||||||
become: True
|
|
Loading…
Reference in New Issue
Block a user