Skip to content

Commit cc1decf

Browse files
committed
Reload systemd after install
1 parent 85f6902 commit cc1decf

File tree

4 files changed

+18
-23
lines changed

4 files changed

+18
-23
lines changed

.travis.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,6 @@ env:
3131
DISTRIBUTION=ubuntu-upstart
3232
DIST_VERSION=14.04
3333
MONGODB_VERSION=3.2
34-
- >
35-
DISTRIBUTION=debian
36-
DIST_VERSION=9-builded
37-
MONGODB_VERSION=3.6
38-
- >
39-
DISTRIBUTION=debian
40-
DIST_VERSION=9-builded
41-
MONGODB_VERSION=3.4
4234
- >
4335
DISTRIBUTION=debian
4436
DIST_VERSION=9-builded

library/mongodb_replication.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def load_mongocnf():
301301

302302
return creds
303303

304-
def wait_for_ok_and_master(module, client, timeout = 120):
304+
def wait_for_ok_and_master(module, client, timeout = 60):
305305
while True:
306306
status = client.admin.command('replSetGetStatus', check=False)
307307
if status['ok'] == 1 and status['myState'] == 1:
@@ -400,7 +400,7 @@ def main():
400400
"username": login_user,
401401
"password": login_password,
402402
"authsource": login_database,
403-
"serverselectiontimeoutms": 110000,
403+
"serverselectiontimeoutms": 30000,
404404
}
405405

406406
if ssl:

tasks/install.debian.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,9 @@
1111
mongodb_is_systemd: "{{ sbin_init.stat.islnk is defined and sbin_init.stat.islnk }}"
1212
mongodb_major_version: "{{ mongodb_version[0:3] }}"
1313

14-
- name: Add systemd configuration if present
15-
copy: src=mongodb.service dest=/lib/systemd/system/mongodb.service owner=root group=root mode=0640
16-
when: mongodb_is_systemd
17-
18-
- name: Add symlink for systemd
19-
file: src=/lib/systemd/system/mongodb.service dest=/etc/systemd/system/multi-user.target.wants/mongodb.service state=link
20-
when: mongodb_is_systemd
21-
notify: reload systemd
22-
23-
- meta: flush_handlers
24-
when: mongodb_is_systemd
14+
- name: Overwrite mongodb_version especially for Debian 9
15+
set_fact:
16+
mongodb_major_version: "3.2"
2517

2618
- name: Add APT key
2719
apt_key:
@@ -47,9 +39,20 @@
4739
- "{{mongodb_package}}"
4840
- numactl
4941

42+
- name: Add systemd configuration if present
43+
copy: src=mongodb.service dest=/lib/systemd/system/mongodb.service owner=root group=root mode=0640
44+
when: mongodb_is_systemd
45+
46+
- name: Add symlink for systemd
47+
file: src=/lib/systemd/system/mongodb.service dest=/etc/systemd/system/multi-user.target.wants/mongodb.service state=link
48+
when: mongodb_is_systemd
49+
notify: reload systemd
50+
5051
- name: reload systemd
5152
shell: systemctl daemon-reload
52-
changed_when: false
53+
when: mongodb_is_systemd and mongodb_manage_service
54+
55+
- meta: flush_handlers
5356
when: mongodb_is_systemd
5457

5558
- name: Install PyMongo package

tests/group_vars/all.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22

33
image_name: "ubuntu-upstart:14.04"
4-
mongodb_version: "3.0"
4+
mongodb_version: "3.6"
55
mongodb_storage_dbpath: /var/lib/mongodb
66
mongodb_net_bindip: 0.0.0.0
77
mongodb_login_host: "{{ hostvars[groups['mongo_master'][0]].ansible_default_ipv4.address }}"

0 commit comments

Comments
 (0)