Skip to content

Commit 1f2f47e

Browse files
authored
Merge pull request #248 from UnderGreen/sergei/add_more_distros_gh_actions
Add more linux distributions in test matrix
2 parents c419a3c + f9b8425 commit 1f2f47e

File tree

16 files changed

+196
-54
lines changed

16 files changed

+196
-54
lines changed

.github/workflows/amazonlinux2.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Amazon Linux 2
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
python3:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
molecule_distro:
17+
- amazonlinux2
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 default test
31+
run: molecule test
32+
env:
33+
PY_COLORS: '1'
34+
ANSIBLE_FORCE_COLOR: '1'
35+
- name: Run default test with enabled authentication
36+
run: AUTH_STATE=enabled molecule test
37+
env:
38+
PY_COLORS: '1'
39+
ANSIBLE_FORCE_COLOR: '1'
40+
- name: Run cluster test
41+
run: molecule test -s cluster
42+
env:
43+
PY_COLORS: '1'
44+
ANSIBLE_FORCE_COLOR: '1'
45+
- name: Run cluster test with enabled authentication
46+
run: AUTH_STATE=enabled molecule test -s cluster
47+
env:
48+
PY_COLORS: '1'
49+
ANSIBLE_FORCE_COLOR: '1'

.github/workflows/centos.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ on:
99
- master
1010

1111
jobs:
12-
python2:
12+
python3:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
1616
molecule_distro:
1717
- centos7
18+
- centos8
1819
mongodb_version:
1920
- '4.2'
2021
- '4.0'
@@ -27,7 +28,23 @@ jobs:
2728
uses: actions/checkout@v2
2829
- name: Prepare tests
2930
run: pip install -r requirements.txt
30-
- name: Run tests
31-
run: |
32-
molecule test
33-
AUTH_STATE=enabled molecule test
31+
- name: Run default test
32+
run: molecule test
33+
env:
34+
PY_COLORS: '1'
35+
ANSIBLE_FORCE_COLOR: '1'
36+
- name: Run default test with enabled authentication
37+
run: AUTH_STATE=enabled molecule test
38+
env:
39+
PY_COLORS: '1'
40+
ANSIBLE_FORCE_COLOR: '1'
41+
- name: Run cluster test
42+
run: molecule test -s cluster
43+
env:
44+
PY_COLORS: '1'
45+
ANSIBLE_FORCE_COLOR: '1'
46+
- name: Run cluster test with enabled authentication
47+
run: AUTH_STATE=enabled molecule test -s cluster
48+
env:
49+
PY_COLORS: '1'
50+
ANSIBLE_FORCE_COLOR: '1'

.github/workflows/debian.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ on:
99
- master
1010

1111
jobs:
12-
python2:
12+
python3:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
molecule_distro:
16+
molecule_distro:
1717
- debian9
1818
- debian10
1919
mongodb_version:
@@ -33,7 +33,23 @@ jobs:
3333
uses: actions/checkout@v2
3434
- name: Prepare tests
3535
run: pip install -r requirements.txt
36-
- name: Run tests
37-
run: |
38-
molecule test
39-
AUTH_STATE=enabled molecule test
36+
- name: Run default test
37+
run: molecule test
38+
env:
39+
PY_COLORS: '1'
40+
ANSIBLE_FORCE_COLOR: '1'
41+
- name: Run default test with enabled authentication
42+
run: AUTH_STATE=enabled molecule test
43+
env:
44+
PY_COLORS: '1'
45+
ANSIBLE_FORCE_COLOR: '1'
46+
- name: Run cluster test
47+
run: molecule test -s cluster
48+
env:
49+
PY_COLORS: '1'
50+
ANSIBLE_FORCE_COLOR: '1'
51+
- name: Run cluster test with enabled authentication
52+
run: AUTH_STATE=enabled molecule test -s cluster
53+
env:
54+
PY_COLORS: '1'
55+
ANSIBLE_FORCE_COLOR: '1'

.github/workflows/ubuntu.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Ubuntu
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
python3:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
molecule_distro:
17+
- ubuntu1604
18+
- ubuntu1804
19+
mongodb_version:
20+
- '4.2'
21+
- '4.0'
22+
- '3.6'
23+
env:
24+
MONGODB_VERSION: ${{ matrix.mongodb_version }}
25+
MOLECULE_DISTRO: ${{ matrix.molecule_distro }}
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v2
29+
- name: Prepare tests
30+
run: pip install -r requirements.txt
31+
- name: Run default test
32+
run: molecule test
33+
env:
34+
PY_COLORS: '1'
35+
ANSIBLE_FORCE_COLOR: '1'
36+
- name: Run default test with enabled authentication
37+
run: AUTH_STATE=enabled molecule test
38+
env:
39+
PY_COLORS: '1'
40+
ANSIBLE_FORCE_COLOR: '1'
41+
- name: Run cluster test
42+
run: molecule test -s cluster
43+
env:
44+
PY_COLORS: '1'
45+
ANSIBLE_FORCE_COLOR: '1'
46+
- name: Run cluster test with enabled authentication
47+
run: AUTH_STATE=enabled molecule test -s cluster
48+
env:
49+
PY_COLORS: '1'
50+
ANSIBLE_FORCE_COLOR: '1'

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@ MongoDB support matrix:
1313

1414
| Distribution | < MongoDB 3.4 | MongoDB 3.6 | MongoDB 4.0 | MongoDB 4.2 |
1515
| -------------- | :-----------: | :----------------: | :----------------: | :----------------: |
16-
| Ubuntu 14.04 | :no_entry: | :white_check_mark: | :white_check_mark: | :x: |
1716
| Ubuntu 16.04 | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
18-
| Ubuntu 18.04 | :no_entry: | :x: | :white_check_mark: | :white_check_mark: |
19-
| Debian 8.x | :no_entry: | :white_check_mark: | :white_check_mark: | :x: |
17+
| Ubuntu 18.04 | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
2018
| Debian 9.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
2119
| Debian 10.x | :no_entry: | :x: | :x: | :white_check_mark: |
22-
| RHEL 6.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
2320
| RHEL 7.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
24-
| Amazon Linux 2 | :no_entry: | :x: | :white_check_mark: | :white_check_mark: |
21+
| RHEL 8.x | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
22+
| Amazon Linux 2 | :no_entry: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
2523

2624
- :white_check_mark: - fully tested, should works fine
2725
- :interrobang: - maybe works, not tested

molecule/cluster/molecule.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ platforms:
3838
- mongo_replicas
3939
provisioner:
4040
name: ansible
41+
config_options:
42+
defaults:
43+
pipelining: true
4144
log: true
4245
playbooks:
4346
converge: ${MOLECULE_PLAYBOOK:-../default/converge.yml}

molecule/default/molecule.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ platforms:
2020
- mongo_master
2121
provisioner:
2222
name: ansible
23+
config_options:
24+
defaults:
25+
pipelining: true
2326
log: true
2427
playbooks:
2528
converge: ${MOLECULE_PLAYBOOK:-converge.yml}

tasks/auth_initialization.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
password: "{{ mongodb_user_admin_password }}",
2828
roles: "userAdminAnyDatabase"
2929
}
30-
no_log: false
30+
no_log: true
3131

3232
- name: create administrative user "{{ mongodb_root_admin_name }}"
3333
mongodb_user:
@@ -43,7 +43,7 @@
4343
password: "{{ mongodb_root_admin_password }}",
4444
roles: "root"
4545
}
46-
no_log: false
46+
no_log: true
4747

4848
- name: create backup user "{{ mongodb_root_backup_name }}"
4949
mongodb_user:
@@ -59,7 +59,7 @@
5959
password: "{{ mongodb_root_backup_password }}",
6060
roles: "backup,clusterMonitor"
6161
}
62-
no_log: false
62+
no_log: true
6363

6464
- name: Move back mongod.conf
6565
template:

tasks/install.amazon.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,14 @@
2828

2929
- name: Install PyMongo package
3030
yum:
31-
name: python-pymongo
31+
name: "{{ mongodb_pymongo_package }}"
3232
state: present
3333
lock_timeout: "{{ yum_lock_timeout }}"
3434
when: not mongodb_pymongo_from_pip
3535

3636
- name: Install PIP
3737
yum:
38-
name:
39-
- python-devel
40-
- python-pip
38+
name: "{{ mongodb_pymongo_deps }}"
4139
lock_timeout: "{{ yum_lock_timeout }}"
4240
when: mongodb_pymongo_from_pip
4341

@@ -46,4 +44,5 @@
4644
name: pymongo
4745
state: "{{ mongodb_pymongo_pip_version is defined | ternary('present', 'latest') }}"
4846
version: "{{ mongodb_pymongo_pip_version | default(omit) }}"
47+
executable: "{{ mongodb_pip_executable }}"
4948
when: mongodb_pymongo_from_pip

tasks/install.debian.yml

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,6 @@
1515
id: "{{ mongodb_apt_key_id[mongodb_major_version] }}"
1616
when: mongodb_package == 'mongodb-org'
1717

18-
- name: Fail when used wrong mongodb_version variable with Debian Stretch
19-
fail:
20-
msg: "mongodb_version variable should be '3.6' or '4.0' or '4.2' for Debian Stretch"
21-
when:
22-
- mongodb_package == 'mongodb-org'
23-
- (mongodb_major_version != '3.6' and mongodb_major_version != '4.0' and mongodb_major_version != '4.2')
24-
- ansible_distribution_release == 'stretch'
25-
26-
- name: Fail when used wrong mongodb_version variable with Ubuntu 18.04
27-
fail:
28-
msg: "mongodb_version variable should be '4.0' or '4.2', or else mongodb_package should be 'mongodb' for Ubuntu 18.04"
29-
when:
30-
- mongodb_package == 'mongodb-org'
31-
- (mongodb_major_version != '4.0' and mongodb_major_version != '4.2')
32-
- ansible_distribution_release == "bionic"
33-
3418
- name: Fail when used wrong mongodb_version variable
3519
fail:
3620
msg: "mongodb_version variable should be '3.6' or '4.0' or '4.2'"
@@ -106,21 +90,18 @@
10690

10791
- name: Install PyMongo package
10892
apt:
109-
name: "{{ 'python-pymongo' if ansible_facts['python'].version.major == 2 else 'python3-pymongo' }}"
93+
name: "{{ mongodb_pymongo_package }}"
11094
when: not mongodb_pymongo_from_pip
11195

11296
- name: Install PIP
11397
apt:
114-
pkg:
115-
- python-dev
116-
- python-pip
98+
pkg: "{{ mongodb_pymongo_deps }}"
11799
when: mongodb_pymongo_from_pip | bool
118100

119101
# TODO: check if it is still needed for Debian/Ubuntu
120102
- name: Install setuptools (required for ansible 2.7+)
121103
apt:
122-
pkg:
123-
- python-setuptools
104+
pkg: "{{ mongodb_python_setuptools }}"
124105
when: mongodb_pymongo_from_pip | bool
125106

126107
- name: Install PyMongo from PIP
@@ -129,4 +110,5 @@
129110
- pymongo
130111
state: "{{ mongodb_pymongo_pip_version is defined | ternary('present', 'latest') }}"
131112
version: "{{ mongodb_pymongo_pip_version | default(omit) }}"
113+
executable: "{{ mongodb_pip_executable }}"
132114
when: mongodb_pymongo_from_pip | bool

0 commit comments

Comments
 (0)