mirror of
https://github.com/status-im/ansible-role-mongodb.git
synced 2025-02-03 08:44:42 +00:00
Reload systemd after install
This commit is contained in:
parent
85f6902ea6
commit
cc1decf1f9
@ -31,14 +31,6 @@ env:
|
||||
DISTRIBUTION=ubuntu-upstart
|
||||
DIST_VERSION=14.04
|
||||
MONGODB_VERSION=3.2
|
||||
- >
|
||||
DISTRIBUTION=debian
|
||||
DIST_VERSION=9-builded
|
||||
MONGODB_VERSION=3.6
|
||||
- >
|
||||
DISTRIBUTION=debian
|
||||
DIST_VERSION=9-builded
|
||||
MONGODB_VERSION=3.4
|
||||
- >
|
||||
DISTRIBUTION=debian
|
||||
DIST_VERSION=9-builded
|
||||
|
@ -301,7 +301,7 @@ def load_mongocnf():
|
||||
|
||||
return creds
|
||||
|
||||
def wait_for_ok_and_master(module, client, timeout = 120):
|
||||
def wait_for_ok_and_master(module, client, timeout = 60):
|
||||
while True:
|
||||
status = client.admin.command('replSetGetStatus', check=False)
|
||||
if status['ok'] == 1 and status['myState'] == 1:
|
||||
@ -400,7 +400,7 @@ def main():
|
||||
"username": login_user,
|
||||
"password": login_password,
|
||||
"authsource": login_database,
|
||||
"serverselectiontimeoutms": 110000,
|
||||
"serverselectiontimeoutms": 30000,
|
||||
}
|
||||
|
||||
if ssl:
|
||||
|
@ -11,17 +11,9 @@
|
||||
mongodb_is_systemd: "{{ sbin_init.stat.islnk is defined and sbin_init.stat.islnk }}"
|
||||
mongodb_major_version: "{{ mongodb_version[0:3] }}"
|
||||
|
||||
- name: Add systemd configuration if present
|
||||
copy: src=mongodb.service dest=/lib/systemd/system/mongodb.service owner=root group=root mode=0640
|
||||
when: mongodb_is_systemd
|
||||
|
||||
- name: Add symlink for systemd
|
||||
file: src=/lib/systemd/system/mongodb.service dest=/etc/systemd/system/multi-user.target.wants/mongodb.service state=link
|
||||
when: mongodb_is_systemd
|
||||
notify: reload systemd
|
||||
|
||||
- meta: flush_handlers
|
||||
when: mongodb_is_systemd
|
||||
- name: Overwrite mongodb_version especially for Debian 9
|
||||
set_fact:
|
||||
mongodb_major_version: "3.2"
|
||||
|
||||
- name: Add APT key
|
||||
apt_key:
|
||||
@ -47,9 +39,20 @@
|
||||
- "{{mongodb_package}}"
|
||||
- numactl
|
||||
|
||||
- name: Add systemd configuration if present
|
||||
copy: src=mongodb.service dest=/lib/systemd/system/mongodb.service owner=root group=root mode=0640
|
||||
when: mongodb_is_systemd
|
||||
|
||||
- name: Add symlink for systemd
|
||||
file: src=/lib/systemd/system/mongodb.service dest=/etc/systemd/system/multi-user.target.wants/mongodb.service state=link
|
||||
when: mongodb_is_systemd
|
||||
notify: reload systemd
|
||||
|
||||
- name: reload systemd
|
||||
shell: systemctl daemon-reload
|
||||
changed_when: false
|
||||
when: mongodb_is_systemd and mongodb_manage_service
|
||||
|
||||
- meta: flush_handlers
|
||||
when: mongodb_is_systemd
|
||||
|
||||
- name: Install PyMongo package
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
|
||||
image_name: "ubuntu-upstart:14.04"
|
||||
mongodb_version: "3.0"
|
||||
mongodb_version: "3.6"
|
||||
mongodb_storage_dbpath: /var/lib/mongodb
|
||||
mongodb_net_bindip: 0.0.0.0
|
||||
mongodb_login_host: "{{ hostvars[groups['mongo_master'][0]].ansible_default_ipv4.address }}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user