Code Monkey home page Code Monkey logo

ansible-drbd's Introduction

Table of Contents generated with DocToc

ansible-drbd

An Ansible role to install/configure DRBD

NOTE: This role by default installs/configures heartbeat to provide HA for DRBD. This may change at some point to use Pacemaker rather than heartbeat. But for simple DRBD setups heartbeat is sufficient and much easier to setup. If you are interested in an Ansible Pacemaker role, I have ansible-pacemaker.

Requirements

The following requirements are needed for this role:

  • Unpartitioned disk
  • VIP

The additional required roles are included in requirements.yml which can be installed using ansible-galaxy:

ansible-galaxy install -r requirements.yml

Role Variables

---
# defaults file for ansible-drbd

drbd_common:
  disk: ''
  net: |
    cram-hmac-alg sha1;
    shared-secret "{{ drbd_network_shared_secret }}";
  handlers: ''
  startup: ''
  options: ''

drbd_disks:
  - device: /dev/drbd0
    disk: /dev/sdb
    filesystem: ext4
    partitions: 1
    mountpoint: /opt/nfs
    resource: r0
    state: present
    use_partition: /dev/sdb1

drbd_group: test_nodes

drbd_interface: enp0s8

drbd_network_shared_secret: wXE8MqVa

drbd_vip: 192.168.250.100

Additional variables include

drbd_use_heartbeat: true
drbd_use_parted: true

Platform Specific Notes

Debian Stretch and Ubuntu Xenial contains DRBD in kernel, and supports Heartbeat. They have the most out of the box support for the defaults.

DRBD packages for CentOS can be built from linbit, or from ELREPO repository. These should be included in the drbd_rpm_packages list. See vagrant-box-templates playbook.yml examples below.

Heartbeat is available for CentOS6, but not for CentOS7. Heartbeat is now optional through a toggle drbd_use_heartbeat. You will be required to handle reboots and failover by other means. Toggle is true by default.

The behaviour of loop disk partitions is has only become more consistent in later linux distributions. To maintain compatibility, the option to toggle off parted drbd_use_parted is provided. Toggle is true by default.

Unicast Mode

For platforms supporting Heartbeat, but not multi-cast UDP, we support a toggle for unicast support. Toggle is false by default.

drbd_unicast_mode: true
drbd_unicast_port: 694

Dependencies

Example Playbook

---
- hosts: test_nodes
  vars:
    etc_hosts_add_all_hosts: true
    pri_domain_name: test.vagrant.local
  roles:
    - role: ansible-ntp
    - role: ansible-etc-hosts
    - role: ansible-drbd

Testing

Testing makes use of vagrant-box-templates, where the following systems have been tested.

  • CentOS6 / CentOS7
  • Debian stretch64
  • Ubuntu xenial64

The nodes.yml and playbook.yml files have been included as working examples. See the tests/ directory for further information.

License

MIT

Author Information

Larry Smith Jr.

ansible-drbd's People

Contributors

mrlesmithjr avatar rooprob avatar etiennebatise avatar wdlstuart avatar

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.