Skip to content

Latest commit

 

History

History
117 lines (78 loc) · 5.83 KB

File metadata and controls

117 lines (78 loc) · 5.83 KB

drbd Cookbook

Cookbook Version CI State OpenCollective OpenCollective License

Installs and configures the Distributed Replicated Block Device (DRBD) service for mirroring block devices between a pair of hosts. Right now it simply works in pairs, multiple hosts could be supported with a few small changes.

This cookbook now exposes a resource-first API for the core DRBD workflow:

  • drbd_install installs the DRBD packages
  • drbd_pair renders pair configuration and exposes initialization, promotion, formatting, and mounting as explicit actions

The legacy drbd::default and drbd::pair recipes remain as compatibility wrappers in this incremental modernization slice.

The drbd cookbook does not partition drives. It will format partitions given a filesystem type, but it does not explicitly depend on the xfs cookbook if you want that type of filesystem, but you can put it in your run list and set the node['drbd']['fs_type'] to 'xfs' or 'ext4' or whatever.

Maintainers

This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If you’d like to know more please visit sous-chefs.org or come chat with us on the Chef Community Slack in #sous-chefs.

Requirements

Platforms

  • Debian
  • Fedora
  • openSUSE Leap
  • Oracle Linux
  • Red Hat Enterprise Linux
  • AlmaLinux
  • Ubuntu

Chef

  • Chef 15.3+

Cookbooks

  • yum-elrepo

Current x86_64 Kitchen verification in this migration branch covers AlmaLinux 9, Debian 12, and Ubuntu 24.04. On EL9 x86_64, the cookbook installs drbd9x-utils and kmod-drbd9x from ELRepo. RHEL support remains declared through the same ELRepo path, and ChefSpec covers that package-selection flow explicitly. EL9 aarch64 and Amazon Linux 2023 remain outside the verified matrix for this release line.

Recipes

drbd_install

Installs DRBD packages. On the RHEL path it bootstraps yum-elrepo by default. EL9 x86_64 installs drbd9x-utils and kmod-drbd9x; older EL releases continue using drbd-utils and kmod-drbd.

drbd_install 'default'

drbd_pair

Renders pair configuration and keeps the stateful replication steps explicit.

drbd_pair 'pair' do
  local_ip '192.0.2.10'
  remote_host 'node-b'
  remote_ip '192.0.2.11'
  disk '/dev/sdb1'
  mount_point '/srv/drbd'
  primary true
  action %i(configure initialize promote format mount)
end

This replaces the old configured node flag with runtime checks against DRBD and the block device. Initial convergence may still be multi-step on real hardware, but the resource no longer relies on persisted node state to reach the mount step.

Legacy Recipe Attributes

The compatibility recipes still map the historical attributes into the new resources. The required attributes are:

  • node['drbd']['remote_host'] - Remote host to pair with.
  • node['drbd']['remote_ip'] - Remote host to pair with.
  • node['drbd']['local_ip'] - Remote host to pair with.
  • node['drbd']['disk'] - Disk partition to mirror.
  • node['drbd']['mount'] - Mount point to mirror.
  • node['drbd']['fs_type'] - Disk format for the mirrored disk, defaults to ext3.
  • node['drbd']['master'] - Whether this node is master between the pair, defaults to false.

The optional attributes are:

  • node['drbd']['packages'] - Optional explicit package override for the compatibility recipes. When unset, the custom resource resolves platform-specific defaults.

Roles

There are a pair of example roles drbd-pair.rb and drbd-pair-master.rb with the cookbook source.

Contributors

This project exists thanks to all the people who contribute.

Backers

Thank you to all our backers!

https://opencollective.com/sous-chefs#backers

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

https://opencollective.com/sous-chefs/sponsor/0/website https://opencollective.com/sous-chefs/sponsor/1/website https://opencollective.com/sous-chefs/sponsor/2/website https://opencollective.com/sous-chefs/sponsor/3/website https://opencollective.com/sous-chefs/sponsor/4/website https://opencollective.com/sous-chefs/sponsor/5/website https://opencollective.com/sous-chefs/sponsor/6/website https://opencollective.com/sous-chefs/sponsor/7/website https://opencollective.com/sous-chefs/sponsor/8/website https://opencollective.com/sous-chefs/sponsor/9/website