From 6449d8fd5630a30f0649e99754219054a4b1ca8e Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Mon, 20 May 2019 16:28:42 +0200 Subject: [PATCH] validate: add a check for nfs standalone if `nfs_obj_gw` is True when deploying an internal ganesha with an external ceph cluster, `ceph_nfs_rgw_access_key` and `ceph_nfs_rgw_secret_key` must be provided so the ganesha configuration file can be generated. Signed-off-by: Guillaume Abrioux (cherry picked from commit 003aeea45a8e232d2bd592c0dc866eb768e9d812) --- roles/ceph-validate/tasks/check_nfs.yml | 8 ++++++++ roles/ceph-validate/tasks/main.yml | 4 ++++ 2 files changed, 12 insertions(+) create mode 100644 roles/ceph-validate/tasks/check_nfs.yml diff --git a/roles/ceph-validate/tasks/check_nfs.yml b/roles/ceph-validate/tasks/check_nfs.yml new file mode 100644 index 000000000..1f78eb4d0 --- /dev/null +++ b/roles/ceph-validate/tasks/check_nfs.yml @@ -0,0 +1,8 @@ +--- +- name: fail if ceph_nfs_rgw_access_key or ceph_nfs_rgw_secret_key are undefined (nfs standalone) + fail: + msg: "ceph_nfs_rgw_access_key and ceph_nfs_rgw_secret_key must be set if nfs_obj_gw is True" + when: + - nfs_obj_gw + - groups.get(mon_group_name, []) | length == 0 + - (ceph_nfs_rgw_access_key is undefined or ceph_nfs_rgw_secret_key is undefined) diff --git a/roles/ceph-validate/tasks/main.yml b/roles/ceph-validate/tasks/main.yml index 30bf99697..bda480c9c 100644 --- a/roles/ceph-validate/tasks/main.yml +++ b/roles/ceph-validate/tasks/main.yml @@ -101,3 +101,7 @@ when: - radosgw_frontend_type == 'civetweb' - radosgw_civetweb_num_threads is defined + +- name: include check_nfs.yml + include_tasks: check_nfs.yml + when: inventory_hostname in groups.get(nfs_group_name, []) -- 2.39.5