{"id":16709632,"url":"https://github.com/mrlesmithjr/ansible-drbd","last_synced_at":"2025-04-10T05:34:23.225Z","repository":{"id":43061189,"uuid":"108697445","full_name":"mrlesmithjr/ansible-drbd","owner":"mrlesmithjr","description":null,"archived":false,"fork":false,"pushed_at":"2021-04-23T17:07:36.000Z","size":23,"stargazers_count":21,"open_issues_count":0,"forks_count":20,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-24T06:51:48.299Z","etag":null,"topics":["ansible","drbd"],"latest_commit_sha":null,"homepage":null,"language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrlesmithjr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-29T01:52:28.000Z","updated_at":"2024-11-02T03:19:41.000Z","dependencies_parsed_at":"2022-08-04T02:30:17.685Z","dependency_job_id":null,"html_url":"https://github.com/mrlesmithjr/ansible-drbd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrlesmithjr%2Fansible-drbd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrlesmithjr%2Fansible-drbd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrlesmithjr%2Fansible-drbd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrlesmithjr%2Fansible-drbd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrlesmithjr","download_url":"https://codeload.github.com/mrlesmithjr/ansible-drbd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248163473,"owners_count":21057949,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","drbd"],"created_at":"2024-10-12T20:05:26.942Z","updated_at":"2025-04-10T05:34:23.168Z","avatar_url":"https://github.com/mrlesmithjr.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n**Table of Contents**  _generated with [DocToc](https://github.com/thlorenz/doctoc)_\n\n-   [ansible-drbd](#ansible-drbd)\n    -   [Requirements](#requirements)\n    -   [Role Variables](#role-variables)\n    -   [Dependencies](#dependencies)\n    -   [Example Playbook](#example-playbook)\n    -   [License](#license)\n    -   [Author Information](#author-information)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n# ansible-drbd\n\nAn [Ansible](https://www.ansible.com) role to install/configure [DRBD](https://docs.linbit.com/)\n\n\u003e NOTE: This role by default installs/configures [heartbeat](http://www.linux-ha.org/wiki/Heartbeat)\n\u003e to provide HA for DRBD. This may change at some point to use [Pacemaker](https://www.clusterlabs.org/)\n\u003e rather than `heartbeat`. But for simple DRBD setups `heartbeat` is sufficient\n\u003e and much easier to setup. If you are interested in an `Ansible` Pacemaker role,\n\u003e I have [ansible-pacemaker](https://github.com/mrlesmithjr/ansible-pacemaker).\n\n## Requirements\n\nThe following requirements are needed for this role:\n\n-   Unpartitioned disk\n-   VIP\n\nThe additional required roles are included in [requirements.yml](requirements.yml)\nwhich can be installed using `ansible-galaxy`:\n\n```bash\nansible-galaxy install -r requirements.yml\n```\n\n## Role Variables\n\n```yaml\n---\n# defaults file for ansible-drbd\n\ndrbd_common:\n  disk: ''\n  net: |\n    cram-hmac-alg sha1;\n    shared-secret \"{{ drbd_network_shared_secret }}\";\n  handlers: ''\n  startup: ''\n  options: ''\n\ndrbd_disks:\n  - device: /dev/drbd0\n    disk: /dev/sdb\n    filesystem: ext4\n    partitions: 1\n    mountpoint: /opt/nfs\n    resource: r0\n    state: present\n    use_partition: /dev/sdb1\n\ndrbd_group: test_nodes\n\ndrbd_interface: enp0s8\n\ndrbd_network_shared_secret: wXE8MqVa\n\ndrbd_vip: 192.168.250.100\n\n```\n\nAdditional variables include\n\n```\ndrbd_use_heartbeat: true\ndrbd_use_parted: true\n```\n\n## Platform Specific Notes\n\nDebian Stretch and Ubuntu Xenial contains DRBD in kernel, and supports Heartbeat.  They have the most out of the box support for the defaults.\n\nDRBD packages for CentOS can be built from [linbit](https://www.linbit.com), or from [ELREPO](http://elrepo.org/) repository. These should be included in the `drbd_rpm_packages` list.  See vagrant-box-templates `playbook.yml` examples below.\n\nHeartbeat 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.\n\nThe 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.\n\n## Unicast Mode\n\nFor platforms supporting Heartbeat, but not multi-cast UDP, we support a toggle for unicast support. Toggle is `false` by default.\n\n```\ndrbd_unicast_mode: true\ndrbd_unicast_port: 694\n```\n\n## Dependencies\n\n-   [ansible-ntp](https://github.com/mrlesmithjr/ansible-ntp)\n-   [ansible-etc-hosts](https://github.com/mrlesmithjr/ansible-etc-hosts)\n\n## Example Playbook\n\n```yaml\n---\n- hosts: test_nodes\n  vars:\n    etc_hosts_add_all_hosts: true\n    pri_domain_name: test.vagrant.local\n  roles:\n    - role: ansible-ntp\n    - role: ansible-etc-hosts\n    - role: ansible-drbd\n```\n\n## Testing\n\nTesting makes use of [vagrant-box-templates](https://github.com/mrlesmithjr/vagrant-box-templates.git), where the following systems have been tested.\n\n* CentOS6 / CentOS7\n* Debian stretch64\n* Ubuntu xenial64\n\nThe `nodes.yml` and `playbook.yml` files have been included as working examples. See the `tests/` directory for further information.\n\n## License\n\nMIT\n\n## Author Information\n\nLarry Smith Jr.\n\n-   [@mrlesmithjr](https://www.twitter.com/mrlesmithjr)\n-   [EverythingShouldBeVirtual](http://everythingshouldbevirtual.com)\n-   [mrlesmithjr.com](http://mrlesmithjr.com)\n-   mrlesmithjr [at] gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrlesmithjr%2Fansible-drbd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrlesmithjr%2Fansible-drbd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrlesmithjr%2Fansible-drbd/lists"}