From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:45:59 +0200 Subject: Adding upstream version 16.2.11+ds. Signed-off-by: Daniel Baumann --- src/ocf/.gitignore | 2 + src/ocf/CMakeLists.txt | 10 ++ src/ocf/rbd.in | 315 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 327 insertions(+) create mode 100644 src/ocf/.gitignore create mode 100644 src/ocf/CMakeLists.txt create mode 100644 src/ocf/rbd.in (limited to 'src/ocf') diff --git a/src/ocf/.gitignore b/src/ocf/.gitignore new file mode 100644 index 000000000..0d609338e --- /dev/null +++ b/src/ocf/.gitignore @@ -0,0 +1,2 @@ +/ceph +/rbd diff --git a/src/ocf/CMakeLists.txt b/src/ocf/CMakeLists.txt new file mode 100644 index 000000000..9a87d02f1 --- /dev/null +++ b/src/ocf/CMakeLists.txt @@ -0,0 +1,10 @@ +# The root of the OCF resource agent hierarchy +# Per the OCF standard, it's always "lib", +# not "lib64" (even on 64-bit platforms). +set(ocf_dir ${CMAKE_INSTALL_PREFIX}/lib/ocf) + +# The ceph provider directory +set(ra_dir ${ocf_dir}/resource.d/${PROJECT_NAME}) + +configure_file(rbd.in rbd @ONLY) +install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/rbd DESTINATION ${ra_dir}) diff --git a/src/ocf/rbd.in b/src/ocf/rbd.in new file mode 100644 index 000000000..cbcc1d5b3 --- /dev/null +++ b/src/ocf/rbd.in @@ -0,0 +1,315 @@ +#!/bin/sh +# +# OCF resource agent for mapping and unmapping +# RADOS Block Devices (RBDs) +# +# License: GNU Lesser General Public License (LGPL) 2.1 or 3.0 +# (c) 2012 Florian Haas, hastexo +# + +# Initialization: +: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat} +. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs + +# Convenience variables +# When sysconfdir isn't passed in as a configure flag, +# it's defined in terms of prefix +prefix=@prefix@ + +# Defaults +OCF_RESKEY_pool_default="rbd" +OCF_RESKEY_cephconf_default="@sysconfdir@/@PACKAGE_TARNAME@/@PACKAGE_TARNAME@.conf" +: ${OCF_RESKEY_pool=${OCF_RESKEY_pool_default}} +: ${OCF_RESKEY_cephconf=${OCF_RESKEY_cephconf_default}} + +rbd_meta_data() { + cat < + + + 0.1 + +Manages RADOS Block Devices (RBDs) as a highly available +resource. Maps and unmaps RBDs as needed. + + Maps and unmaps RADOS Block Devices + + + + Name of the RBD device. + + RBD device name + + + + + Name of the RADOS pool namespace where the RBD has been created + + RADOS pool namespace name + + + + Name of the RADOS pool where the RBD has been created + + RADOS pool name + + + + + Name of the device snapshot to map. + + Snapshot name + + + + + Location of the Ceph configuration file + + Ceph configuration file + + + + + Address (or comma-separated list of addresses) of + monitor servers to connect to. Overrides values from + configuration file. + + Monitor address(es) + + + + + Username to use when mapping the device. Required + if Ceph authentication is enabled on the monitor. + + Authentication username + + + + + File containing an authentication secret. Required + if Ceph authentication is enabled on the monitor. + + Authentication secret file + + + + + + + + + + + +EOF +} + +rbd_usage() { + cat <