Skip to content

Commit 118d142

Browse files
authored
Merge pull request #245 from UnderGreen/molecule
Initial molecule adaptation
2 parents b3dde4d + b601f0f commit 118d142

26 files changed

+325
-197
lines changed

.github/workflows/centos.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test ansible role on CentOS
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
python2:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
molecule_distro:
17+
- centos7
18+
mongodb_version:
19+
- '4.2'
20+
- '4.0'
21+
- '3.6'
22+
env:
23+
MONGODB_VERSION: ${{ matrix.mongodb_version }}
24+
MOLECULE_DISTRO: ${{ matrix.molecule_distro }}
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v2
28+
- name: Prepare tests
29+
run: pip install -r requirements.txt
30+
- name: Run tests
31+
run: |
32+
molecule test
33+
AUTH_STATE=enabled molecule test

.github/workflows/debian.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Test ansible role on Debian
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
python2:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
molecule_distro:
17+
- debian9
18+
- debian10
19+
mongodb_version:
20+
- '4.2'
21+
- '4.0'
22+
- '3.6'
23+
exclude:
24+
- molecule_distro: debian10
25+
mongodb_version: '3.6'
26+
- molecule_distro: debian10
27+
mongodb_version: '4.0'
28+
env:
29+
MONGODB_VERSION: ${{ matrix.mongodb_version }}
30+
MOLECULE_DISTRO: ${{ matrix.molecule_distro }}
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v2
34+
- name: Prepare tests
35+
run: pip install -r requirements.txt
36+
- name: Run tests
37+
run: |
38+
molecule test
39+
AUTH_STATE=enabled molecule test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ tests/*.retry
44
.\#*
55
/.python-version
66
*.pyc
7+
/.cache
8+
/venv

.travis.yml

Lines changed: 0 additions & 163 deletions
This file was deleted.

.yamllint

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
# Based on ansible-lint config
3+
extends: default
4+
5+
ignore: |
6+
venv
7+
8+
rules:
9+
braces:
10+
max-spaces-inside: 1
11+
level: error
12+
brackets:
13+
max-spaces-inside: 1
14+
level: error
15+
colons:
16+
max-spaces-after: -1
17+
level: error
18+
commas:
19+
max-spaces-after: -1
20+
level: error
21+
comments: disable
22+
comments-indentation: disable
23+
document-start: disable
24+
empty-lines:
25+
max: 3
26+
level: error
27+
hyphens:
28+
level: error
29+
indentation: disable
30+
key-duplicates: enable
31+
line-length: disable
32+
new-line-at-end-of-file: disable
33+
new-lines:
34+
type: unix
35+
trailing-spaces: disable
36+
truthy: disable

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ Ansible role which manages [MongoDB](http://www.mongodb.org/).
1010

1111
MongoDB support matrix:
1212

13-
| Distribution | < MongoDB 3.2 | MongoDB 3.4 | MongoDB 3.6 | MongoDB 4.0 | MongoDB 4.2 |
14-
| -------------- | :-----------: | :----------------: | :----------------: | :----------------: | :----------------: |
15-
| Ubuntu 14.04 | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: |
16-
| Ubuntu 16.04 | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
17-
| Ubuntu 18.04 | :no_entry: | :x: | :x: | :white_check_mark: | :white_check_mark: |
18-
| Debian 8.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: |
19-
| Debian 9.x | :no_entry: | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
20-
| RHEL 6.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
21-
| RHEL 7.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
22-
| Amazon Linux 2 | :no_entry: | :white_check_mark: | :x: | :white_check_mark: | :white_check_mark: |
13+
| Distribution | < MongoDB 3.4 | MongoDB 3.6 | MongoDB 4.0 | MongoDB 4.2 |
14+
| -------------- | :-----------: | :----------------: | :----------------: | :----------------: |
15+
| Ubuntu 14.04 | :no_entry: | :white_check_mark: | :white_check_mark: | :x: |
16+
| Ubuntu 16.04 | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
17+
| Ubuntu 18.04 | :no_entry: | :x: | :white_check_mark: | :white_check_mark: |
18+
| Debian 8.x | :no_entry: | :white_check_mark: | :white_check_mark: | :x: |
19+
| Debian 9.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
20+
| RHEL 6.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
21+
| RHEL 7.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
22+
| Amazon Linux 2 | :no_entry: | :x: | :white_check_mark: | :white_check_mark: |
2323

2424
- :white_check_mark: - fully tested, should works fine
2525
- :interrobang: - maybe works, not tested
@@ -35,7 +35,7 @@ MongoDB support matrix:
3535
mongodb_package: mongodb-org
3636

3737
# You can control installed version via this param.
38-
# Should be '3.4', '3.6', '4.0' or '4.2'. This role doesn't support MongoDB < 3.4.
38+
# Should be '3.6', '4.0' or '4.2'. This role doesn't support MongoDB < 3.6.
3939
# I will recommend you to use latest version of MongoDB.
4040
mongodb_version: "4.2"
4141

defaults/main.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ mongodb_package_state: present
55
mongodb_version: "4.2"
66
mongodb_apt_keyserver: keyserver.ubuntu.com
77
mongodb_apt_key_id:
8-
"3.4": "0C49F3730359A14518585931BC711F9BA15703C6"
98
"3.6": "2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5"
109
"4.0": "9DA31620334BD75D9DCB49F368818C72E52529D4"
1110
"4.2": "E162F504A20CDF15827F718D4B7C549A058F8B6B"
1211

1312
mongodb_pymongo_from_pip: true # Install latest PyMongo via PIP or package manager
14-
mongodb_pymongo_pip_version: 3.7.1
13+
mongodb_pymongo_pip_version: 3.11.3
1514

1615
mongodb_user_update_password: "on_create" # MongoDB user password update default policy
1716
mongodb_manage_service: true
@@ -126,4 +125,4 @@ mongodb_root_backup_password: passw0rd
126125
mongodb_set_parameters:
127126

128127
# custom config options
129-
mongodb_config:
128+
mongodb_config:

handlers/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,3 @@
4141
port: "{{ mongodb_net_port }}"
4242
delay: 5
4343
timeout: 120
44-

library/mongodb_replication.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python
22

3-
# (c) 2015-2018, Sergei Antipov, 2GIS LLC
3+
# (c) 2015-2021, Sergei Antipov
44
#
55
# This file is part of Ansible
66
#

meta/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ dependencies: []
33

44
galaxy_info:
55
author: Sergei Antipov
6+
role_name: mongodb
7+
namespace: undergreen
68
company: Self-employed
79
description: Manage MongoDB with authentication and replica sets
810
license: GPLv2
9-
min_ansible_version: 2.5
11+
min_ansible_version: 2.8
1012
platforms:
1113
- name: Ubuntu
1214
versions:

0 commit comments

Comments
 (0)