Skip to content
Snippets Groups Projects
Verified Commit 53714e2c authored by nd's avatar nd
Browse files

first working version

parent fe5433cd
Branches
Tags 4.1.1
No related merge requests found
mongodb: {}
mongodb:
version: "4.2"
......@@ -2,3 +2,6 @@
systemd:
state: restarted
name: mongod.service
- name: start mongodb replication
shell: sleep 3; mongo --eval "printjson(rs.initiate())"
......@@ -3,9 +3,18 @@
pkg:
- mongodb-org
- name: enable replication sets
notify:
- restart mongodb
- start mongodb replication
lineinfile:
path: /etc/mongod.conf
regexp: "^#replication:"
line: "replication:\n replSetName: rs01"
- name: start and enable mongodb
systemd:
state: started
name: mongodb
name: mongod
daemon_reload: yes
enabled: yes
packages:
repos:
mongodb:
url: "deb http://repo.mongodb.org/apt/debian {{ ansible_distribution|lower }}/mongodb-org/4.0 main"
keyid: "9DA31620334BD75D9DCB49F368818C72E52529D4"
keyserver: keyserver.ubuntu.com
url: "deb http://repo.mongodb.org/apt/debian {{ ansible_distribution_release|lower }}/mongodb-org/{{ mongodb.version }} main"
keyurl: "https://www.mongodb.org/static/pgp/server-{{ mongodb.version }}.asc"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment