Skip to content

Commit 659e3e7

Browse files
committed
Add Amazon Linux and cluster tests
1 parent c419a3c commit 659e3e7

File tree

7 files changed

+54
-9
lines changed

7 files changed

+54
-9
lines changed

.github/workflows/amazonlinux2.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
python2:
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 tests
31+
run: |
32+
molecule test
33+
AUTH_STATE=enabled molecule test
34+
molecule test -s cluster
35+
AUTH_STATE=enabled molecule test -s cluster

.github/workflows/centos.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ jobs:
3131
run: |
3232
molecule test
3333
AUTH_STATE=enabled molecule test
34+
molecule test -s cluster
35+
AUTH_STATE=enabled molecule test -s cluster

.github/workflows/debian.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
molecule_distro:
16+
molecule_distro:
1717
- debian9
1818
- debian10
1919
mongodb_version:
@@ -37,3 +37,5 @@ jobs:
3737
run: |
3838
molecule test
3939
AUTH_STATE=enabled molecule test
40+
molecule test -s cluster
41+
AUTH_STATE=enabled molecule test -s cluster

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/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
ignore_errors: true
5454
when: ( mongodb_security_authorization == 'enabled'
5555
and not mongodb_replication_replset )
56-
no_log: false
56+
no_log: true
5757
tags: [mongodb]
5858

5959
- name: Include authorization configuration
@@ -80,7 +80,7 @@
8080
when: ( mongodb_replication_replset
8181
and mongodb_security_authorization == 'enabled'
8282
and mongodb_master is defined and mongodb_master )
83-
no_log: false
83+
no_log: true
8484
tags: [mongodb]
8585

8686
- name: create normal users without replicaset
@@ -92,14 +92,14 @@
9292
roles: "{{ item.roles }}"
9393
login_user: "{{ mongodb_user_admin_name }}"
9494
login_password: "{{ mongodb_user_admin_password }}"
95-
login_port: "{{ mongodb_net_port }}"
95+
login_port: "{{ mongodb_net_port | int }}"
9696
login_host: "{{ mongodb_login_host|default('localhost') }}"
9797
ssl: "{{ True if mongodb_net_ssl_mode == 'requireSSL' else False }}"
9898
with_items:
9999
- "{{ mongodb_users | default([]) }}"
100100
when: ( mongodb_security_authorization == 'enabled'
101101
and not mongodb_replication_replset )
102-
no_log: false
102+
no_log: true
103103
tags: [mongodb]
104104

105105
- name: create oplog user with replicaset
@@ -121,7 +121,7 @@
121121
when: ( mongodb_replication_replset | length > 0
122122
and mongodb_security_authorization == 'enabled'
123123
and mongodb_master is defined and mongodb_master )
124-
no_log: false
124+
no_log: true
125125
tags: [mongodb]
126126

127127
- name: service started

0 commit comments

Comments
 (0)