Coder Social home page Coder Social logo

ansible-mongo-replicaset's Introduction

Example to configure MongoDB replica set using Ansible

Getting started

  • Update hosts inventory file with correct mongod virtual machine addresses. Make sure primary is the first one on list. One of the nodes is arbiter.
  • Make sure you have ansible.cfg configured with correct host file path and ssh key file. E.g. \
    [defaults]
    inventory = ./hosts
    private_key_file=<path-to-pem-file>
  • Run ansible-playbook site.yml

Notes about security

Current implementation enables authentication and uses keyfiles for internal authentication. The role security contains file named "secret". This is the content of the keyfile and is copied to each replica-set member.

In order to create a key file with a complex pseudo-random 1024 character string run openssl rand -base64 756 > <path-to-keyfile>

For an improved production ready security use x.509 certificates instead of keyfiles. More information about internal authentication see MongoDB docs for: Internal-authentication

Role mongo-users adds example users to database. Usernames and passwords are written just for example. Those should be replaced with real ones read from vault.

ansible-mongo-replicaset's People

Contributors

janipm avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

prasadmoru vipsql

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.