#ceph_stable_release: dummy
#ceph_stable_repo: "{{ ceph_mirror }}/debian-{{ ceph_stable_release }}"
+#nfs_ganesha_stable: true # use stable repos for nfs-ganesha
+#nfs_ganesha_stable_branch: V2.5-stable
+#nfs_ganesha_stable_deb_repo: "{{ ceph_mirror }}/nfs-ganesha/deb-{{ nfs_ganesha_stable_branch }}/{{ ceph_stable_release }}"
+
+
# Use the option below to specify your applicable package tree, eg. when using non-LTS Ubuntu versions
# # for a list of available Debian distributions, visit http://download.ceph.com/debian-{{ ceph_stable_release }}/dists/
# for more info read: https://github.com/ceph/ceph-ansible/issues/305
#ceph_dev_branch: master # development branch you would like to use e.g: master, wip-hack
#ceph_dev_sha1: latest # distinct sha1 to use, defaults to 'latest' (as in latest built)
+#nfs_ganesha_dev: false # use development repos for nfs-ganesha
+
+# Set this to choose the version of ceph dev libraries used in the nfs-ganesha packages from shaman
+# flavors so far include: ceph_master, ceph_jewel, ceph_kraken, ceph_luminous
+#nfs_ganesha_flavor: "ceph_master"
# REPOSITORY: CUSTOM
#handler_health_rgw_check_retries: 5
#handler_health_rgw_check_delay: 10
+###############
+# NFS-GANESHA #
+###############
+
# Confiure the type of NFS gatway access. At least one must be enabled for an
# NFS role to be useful
#
# Set this to true to enable File access via NFS. Requires an MDS role.
-#nfs_file_gw: true
+#nfs_file_gw: false
# Set this to true to enable Object access via NFS. Requires an RGW role.
-#nfs_obj_gw: false
+#nfs_obj_gw: true
###################
# CONFIG OVERRIDE #
#fetch_directory: fetch/
+# Even though NFS nodes should not have the admin key
+# at their disposal, some people might want to have it
+# distributed on RGW nodes. Setting 'copy_admin_key' to 'true'
+# will copy the admin key to the /etc/ceph/ directory
+#copy_admin_key: false
+
#######################
# Access type options #
#######################
# These are currently in ceph-common defaults because nfs_obj_gw shared with ceph-rgw
# Enable NFS File access
-#nfs_file_gw: true
+#nfs_file_gw: false
# Enable NFS Object access
-#nfs_obj_gw: false
+#nfs_obj_gw: true
######################
# NFS Ganesha Config #
#ceph_nfs_rgw_access_key: "QFAMEDSJP5DEKJO0DDXY"
#ceph_nfs_rgw_secret_key: "iaSFLDVvDdQt6lkNzHyW4fPLZugBAI1g17LO0+87[MAC[M#C"
-
-###################
-# CONFIG OVERRIDE #
-###################
-
-# Ganesha configuration file override.
-# This allows you to specify more configuration options
-# using an INI style format.
-# The following sections are supported: [global], [mon], [osd], [mds], [rgw]
-#
-# Example:
-# ceph_conf_overrides:
-# global:
-# foo: 1234
-# bar: 5678
-#
-#ganesha_conf_overrides: {}
-
##########
# DOCKER #
##########
#ceph_stable_release: dummy
#ceph_stable_repo: "{{ ceph_mirror }}/debian-{{ ceph_stable_release }}"
+#nfs_ganesha_stable: true # use stable repos for nfs-ganesha
+#nfs_ganesha_stable_branch: V2.5-stable
+#nfs_ganesha_stable_deb_repo: "{{ ceph_mirror }}/nfs-ganesha/deb-{{ nfs_ganesha_stable_branch }}/{{ ceph_stable_release }}"
+
+
# Use the option below to specify your applicable package tree, eg. when using non-LTS Ubuntu versions
# # for a list of available Debian distributions, visit http://download.ceph.com/debian-{{ ceph_stable_release }}/dists/
# for more info read: https://github.com/ceph/ceph-ansible/issues/305
#ceph_dev_branch: master # development branch you would like to use e.g: master, wip-hack
#ceph_dev_sha1: latest # distinct sha1 to use, defaults to 'latest' (as in latest built)
+#nfs_ganesha_dev: false # use development repos for nfs-ganesha
+
+# Set this to choose the version of ceph dev libraries used in the nfs-ganesha packages from shaman
+# flavors so far include: ceph_master, ceph_jewel, ceph_kraken, ceph_luminous
+#nfs_ganesha_flavor: "ceph_master"
# REPOSITORY: CUSTOM
#handler_health_rgw_check_retries: 5
#handler_health_rgw_check_delay: 10
+###############
+# NFS-GANESHA #
+###############
+
# Confiure the type of NFS gatway access. At least one must be enabled for an
# NFS role to be useful
#
# Set this to true to enable File access via NFS. Requires an MDS role.
-#nfs_file_gw: true
+#nfs_file_gw: false
# Set this to true to enable Object access via NFS. Requires an RGW role.
-#nfs_obj_gw: false
+#nfs_obj_gw: true
###################
# CONFIG OVERRIDE #
state: present
changed_when: false
-- name: configure debian gluster nfs ganesha community repository for rgw nfs
+- name: add nfs-ganesha stable repository
apt_repository:
- repo: "{{ item }}"
+ repo: "deb {{ nfs_ganesha_stable_deb_repo }} {{ ceph_stable_distro_source | default(ansible_lsb.codename) }} main"
state: present
- with_items:
- - ppa:gluster/libntirpc
- - ppa:gluster/nfs-ganesha
changed_when: false
when:
- - (nfs_obj_gw or nfs_file_gw)
- - not ansible_distribution == "Debian"
+ - nfs_group_name in group_names
+ - nfs_ganesha_stable
repo: "{{ ceph_dev_deb_repo.content }}"
state: present
changed_when: false
+
+- name: fetch nfs-ganesha development repository
+ uri:
+ url: https://shaman.ceph.com/api/repos/nfs-ganesha/next/latest/{{ ansible_distribution | lower }}/{{ ansible_distribution_release }}/flavors/{{ nfs_ganesha_flavor }}/repo
+ return_content: yes
+ register: nfs_ganesha_apt_repo
+ when:
+ - nfs_group_name in group_names
+ - nfs_ganesha_dev
+
+- name: add nfs-ganesha development repository
+ copy:
+ content: "{{ nfs_ganesha_dev_apt_repo.content }}"
+ dest: /etc/apt/sources.list.d/nfs-ganesha-dev.list
+ owner: root
+ group: root
+ backup: yes
+ when:
+ - nfs_group_name in group_names
+ - nfs_ganesha_dev
+
- name: install red hat storage nfs gateway for debian
apt:
- name: nfs-ganesha-fsal
+ name: nfs-ganesha
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: nfs_group_name in group_names
+- name: install red hat storage nfs file gateway
+ apt:
+ name: nfs-ganesha-ceph
+ state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
+ when:
+ - nfs_group_name in group_names
+ - nfs_file_gw
+
+- name: install red hat storage nfs obj gateway
+ apt:
+ name: nfs-ganesha-rgw
+ state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
+ when:
+ - nfs_group_name in group_names
+ - nfs_obj_gw
+
- name: install ceph mgr for debian
apt:
pkg: ceph-mgr
when:
- nfs_group_name in group_names
-- name: install nfs gateway for debian
- apt:
- name: nfs-ganesha-fsal
- state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
- update_cache: yes
+- name: install nfs cephfs gateway
+ package:
+ name: nfs-ganesha-ceph
+ when:
+ - nfs_group_name in group_names
+ - nfs_file_gw
+
+- name: install nfs rgw gateway
+ package:
+ name: "{{ item }}"
+ with_items:
+ - nfs-ganesha-rgw
+ - radosgw
when:
- nfs_group_name in group_names
+ - nfs_obj_gw
- name: install ceph mgr for debian
apt:
- nfs_group_name in group_names
- nfs_file_gw
-- name: install redhat nfs-ganesha-rgw and ceph-radosgw packages
+- name: install nfs cephfs gateway
package:
- name: "{{ item }}"
- with_items:
- - nfs-ganesha-fsal
- - ceph-radosgw
+ name: nfs-ganesha-ceph
when:
- nfs_group_name in group_names
- - nfs_obj_gw
- - ceph_rhcs_version == "2"
+ - nfs_file_gw
- name: install redhat nfs-ganesha-rgw and ceph-radosgw packages
package:
name: "{{ item }}"
with_items:
- nfs-ganesha-rgw
- - nfs-ganesha-ceph
- ceph-radosgw
when:
- nfs_group_name in group_names
- nfs_obj_gw
- - ceph_rhcs_version == "3"
- name: install redhat ceph-mgr package
package:
state: present
gpgkey: "{{ ceph_stable_key }}"
baseurl: "{{ ceph_mirror }}/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/$basearch"
+
+- name: add nfs-ganesha stable repository
+ yum_repository:
+ name: nfs_ganesha_stable
+ description: nfs-ganesha stable repo
+ gpgcheck: yes
+ state: present
+ gpgkey: "{{ ceph_stable_key }}"
+ baseurl: "{{ ceph_mirror }}/nfs-ganesha/rpm-{{ nfs_ganesha_stable_branch }}/{{ ceph_stable_release }}/$basearch"
+ when:
+ - nfs_group_name in group_names
+ - nfs_ganesha_stable
+
owner: root
group: root
backup: yes
+
+- name: fetch nfs-ganesha red hat development repository
+ uri:
+ url: https://shaman.ceph.com/api/repos/nfs-ganesha/next/latest/{{ ansible_distribution | lower }}/{{ ansible_distribution_major_version }}/flavors/{{ nfs_ganesha_flavor }}/repo
+ return_content: yes
+ register: nfs_ganesha_dev_yum_repo
+ when:
+ - nfs_group_name in group_names
+ - nfs_ganesha_dev
+
+- name: add nfs-ganesha development repository
+ copy:
+ content: "{{ nfs_ganesha_dev_yum_repo.content }}"
+ dest: /etc/yum.repos.d/nfs-ganesha-dev.repo
+ owner: root
+ group: root
+ backup: yes
+ when:
+ - nfs_group_name in group_names
+ - nfs_ganesha_dev
+
ceph_stable_release: dummy
ceph_stable_repo: "{{ ceph_mirror }}/debian-{{ ceph_stable_release }}"
+nfs_ganesha_stable: true # use stable repos for nfs-ganesha
+nfs_ganesha_stable_branch: V2.5-stable
+nfs_ganesha_stable_deb_repo: "{{ ceph_mirror }}/nfs-ganesha/deb-{{ nfs_ganesha_stable_branch }}/{{ ceph_stable_release }}"
+
+
# Use the option below to specify your applicable package tree, eg. when using non-LTS Ubuntu versions
# # for a list of available Debian distributions, visit http://download.ceph.com/debian-{{ ceph_stable_release }}/dists/
# for more info read: https://github.com/ceph/ceph-ansible/issues/305
ceph_dev_branch: master # development branch you would like to use e.g: master, wip-hack
ceph_dev_sha1: latest # distinct sha1 to use, defaults to 'latest' (as in latest built)
+nfs_ganesha_dev: false # use development repos for nfs-ganesha
+
+# Set this to choose the version of ceph dev libraries used in the nfs-ganesha packages from shaman
+# flavors so far include: ceph_master, ceph_jewel, ceph_kraken, ceph_luminous
+nfs_ganesha_flavor: "ceph_master"
# REPOSITORY: CUSTOM
handler_health_rgw_check_retries: 5
handler_health_rgw_check_delay: 10
+###############
+# NFS-GANESHA #
+###############
+
# Confiure the type of NFS gatway access. At least one must be enabled for an
# NFS role to be useful
#
# Set this to true to enable File access via NFS. Requires an MDS role.
-nfs_file_gw: true
+nfs_file_gw: false
# Set this to true to enable Object access via NFS. Requires an RGW role.
-nfs_obj_gw: false
+nfs_obj_gw: true
###################
# CONFIG OVERRIDE #
fetch_directory: fetch/
+# Even though NFS nodes should not have the admin key
+# at their disposal, some people might want to have it
+# distributed on RGW nodes. Setting 'copy_admin_key' to 'true'
+# will copy the admin key to the /etc/ceph/ directory
+copy_admin_key: yes
+
#######################
# Access type options #
#######################
# These are currently in ceph-common defaults because nfs_obj_gw shared with ceph-rgw
# Enable NFS File access
-#nfs_file_gw: true
+nfs_file_gw: false
# Enable NFS Object access
-#nfs_obj_gw: false
+nfs_obj_gw: true
######################
# NFS Ganesha Config #
#ceph_nfs_rgw_secret_key: "iaSFLDVvDdQt6lkNzHyW4fPLZugBAI1g17LO0+87[MAC[M#C"
-###################
-# CONFIG OVERRIDE #
-###################
-
-# Ganesha configuration file override.
-# This allows you to specify more configuration options
-# using an INI style format.
-# The following sections are supported: [global], [mon], [osd], [mds], [rgw]
-#
-# Example:
-# ceph_conf_overrides:
-# global:
-# foo: 1234
-# bar: 5678
-#
-ganesha_conf_overrides: {}
-
##########
# DOCKER #
##########
---
-- name: create nfs gateway directories
- file:
- path: "{{ item }}"
- state: directory
- owner: "ceph"
- group: "ceph"
- mode: "0755"
- with_items:
- - /var/lib/nfs/ganesha
- - /var/run/ganesha
-
- name: create rgw nfs user
command: radosgw-admin --cluster {{ cluster }} user create --uid={{ ceph_nfs_rgw_user }} --display-name="RGW NFS User"
register: rgwuser
+ delegate_to: "{{ groups[mon_group_name][0] }}"
when: nfs_obj_gw
- name: set access key
set_fact:
ceph_nfs_rgw_access_key: "{{ (rgwuser.stdout | from_json)['keys'][0]['access_key'] }}"
- when: nfs_obj_gw
+ delegate_to: "{{ groups[mon_group_name][0] }}"
+ when:
+ - nfs_obj_gw
+ - ceph_nfs_rgw_access_key is not defined
- name: set secret key
set_fact:
ceph_nfs_rgw_secret_key: "{{(rgwuser.stdout | from_json)['keys'][0]['secret_key']}}"
- when: nfs_obj_gw
+ delegate_to: "{{ groups[mon_group_name][0] }}"
+ when:
+ - nfs_obj_gw
+ - ceph_nfs_rgw_secret_key is not defined
+
+- name: create nfs gateway directories
+ file:
+ path: "{{ item }}"
+ state: directory
+ owner: "ceph"
+ group: "ceph"
+ mode: "0755"
+ with_items:
+ - /var/lib/nfs/ganesha
+ - /var/run/ganesha
- name: generate ganesha configuration file
action: config_template
owner: "root"
group: "root"
mode: "0644"
- config_overrides: "{{ ganesha_conf_overrides }}"
config_type: ini
- name: start nfs gateway service