Merge branch 'master' of https://github.com/UnderGreen/ansible-role-mongodb into manage_unit_systemd

This commit is contained in:
Mikhail Konyakhin 2019-12-13 16:43:53 +03:00
commit fc41e73edf
5 changed files with 17 additions and 6 deletions

View File

@ -6,7 +6,7 @@ Ansible role which manages [MongoDB](http://www.mongodb.org/).
- Configure mongodb users
- Configure replication
- Provide handlers for restart and reload;
- Setup MMS authomation agent;
- Setup MMS automation agent;
MongoDB support matrix:
@ -14,12 +14,12 @@ MongoDB support matrix:
| -------------- | :-----------: | :----------------: | :----------------: | :----------------: | :----------------: |
| Ubuntu 14.04 | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: |
| Ubuntu 16.04 | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Ubuntu 18.04 | :no_entry: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Ubuntu 18.04 | :no_entry: | :x: | :x: | :white_check_mark: | :white_check_mark: |
| Debian 8.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: |
| Debian 9.x | :no_entry: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| RHEL 6.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| RHEL 7.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Amazon Linux 2 | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| Amazon Linux 2 | :no_entry: | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: |
- :white_check_mark: - fully tested, should works fine
- :interrobang: - maybe works, not tested
@ -35,9 +35,9 @@ MongoDB support matrix:
mongodb_package: mongodb-org
# You can control installed version via this param.
# Should be '3.4', '3.6' or '4.0'. This role doesn't support MongoDB < 3.4.
# Should be '3.4', '3.6', '4.0' or '4.2'. This role doesn't support MongoDB < 3.4.
# I will recommend you to use latest version of MongoDB.
mongodb_version: "3.6"
mongodb_version: "4.2"
mongodb_pymongo_from_pip: true # Install latest PyMongo via PIP or package manager
mongodb_pymongo_pip_version: 3.6.1 # Choose PyMong version to install from pip. If not set use latest

View File

@ -17,16 +17,19 @@
yum:
name: "{{ mongodb_package }}{% if (mongodb_version | length > 3) %}={{ mongodb_version }}{% endif %}"
state: "{{ mongodb_package_state }}"
lock_timeout: "{{ yum_lock_timeout }}"
- name: Install numactl package
yum:
name: numactl
state: present
lock_timeout: "{{ yum_lock_timeout }}"
- name: Install PyMongo package
yum:
name: python-pymongo
state: present
lock_timeout: "{{ yum_lock_timeout }}"
when: not mongodb_pymongo_from_pip
- name: Install PIP
@ -34,6 +37,7 @@
name:
- python-devel
- python-pip
lock_timeout: "{{ yum_lock_timeout }}"
when: mongodb_pymongo_from_pip
- name: Install PyMongo from PIP

View File

@ -23,16 +23,19 @@
yum:
name: "{{ mongodb_package }}{% if (mongodb_version | length > 3) %}={{ mongodb_version }}{% endif %}"
state: "{{ mongodb_package_state }}"
lock_timeout: "{{ yum_lock_timeout }}"
- name: Install numactl package
yum:
name: numactl
state: present
lock_timeout: "{{ yum_lock_timeout }}"
- name: Install PyMongo package
yum:
name: python-pymongo
state: present
lock_timeout: "{{ yum_lock_timeout }}"
when: not mongodb_pymongo_from_pip
- name: Install PIP
@ -40,6 +43,7 @@
name:
- python-devel
- python-pip
lock_timeout: "{{ yum_lock_timeout }}"
when: mongodb_pymongo_from_pip | bool
- name: Install PyMongo from PIP

View File

@ -11,3 +11,5 @@ mongodb_repository_gpgkey:
"3.6": "https://www.mongodb.org/static/pgp/server-3.6.asc"
mongodb_pidfile_path: "{{ '/var/run/mongodb/mongod.pid' if ('mongodb-org' in mongodb_package) else '' }}"
yum_lock_timeout: 180

View File

@ -1,5 +1,4 @@
---
mongodb_repository:
"3.4": "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/$basearch/"
"3.6": "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.6/$basearch/"
@ -13,3 +12,5 @@ mongodb_repository_gpgkey:
"4.2": "https://www.mongodb.org/static/pgp/server-4.2.asc"
mongodb_pidfile_path: "{{ '/var/run/mongodb/mongod.pid' if ('mongodb-org' in mongodb_package) else '' }}"
yum_lock_timeout: 180