As Ali Maredia explains (in
https://github.com/ceph/ceph-ansible/issues/1907#issuecomment-
331200448),
since the Ceph RGW/NFS gateway (with the nfs-ganesha RGW FSAL) is not
supported for any stable Ceph release prior to Luminous, the
nfs_obj_gw variable does not serve any real purpose in this
branch. Thus, remove it along with all references that use it.
#
# Set this to true to enable File access via NFS. Requires an MDS role.
#nfs_file_gw: true
-# Set this to true to enable Object access via NFS. Requires an RGW role.
-#nfs_obj_gw: false
# this is only here for usage with the rolling_update.yml playbook
# do not ever change this here
#######################
# 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
# Enable NFS Object access
#
# Set this to true to enable File access via NFS. Requires an MDS role.
nfs_file_gw: true
-# Set this to true to enable Object access via NFS. Requires an RGW role.
-nfs_obj_gw: false
# this is only here for usage with the rolling_update.yml playbook
# do not ever change this here
- ppa:gluster/nfs-ganesha-2.5
changed_when: false
when:
- - (nfs_obj_gw or nfs_file_gw)
+ - nfs_file_gw
- not ansible_distribution == "Debian"
- nfs_group_name in group_names
- nfs_file_gw
-- name: install nfs rgw gateway
- package:
- name: "{{ item }}"
- with_items:
- - nfs-ganesha-rgw
- - ceph-radosgw
- when:
- - nfs_group_name in group_names
- - nfs_obj_gw
-
- name: install ceph mgr
package:
name: ceph-mgr
#######################
# 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
-# Enable NFS Object access
-#nfs_obj_gw: false
######################
# NFS Ganesha Config #
group: root
mode: 0644
-- name: create the nfs rgw user
- docker:
- image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
- name: ceph-rgw-user-{{ ansible_hostname }}
- hostname: "{{ ansible_hostname }}"
- expose: "{{ ceph_rgw_civetweb_port }}"
- ports: "{{ ceph_rgw_civetweb_port }}:{{ ceph_rgw_civetweb_port }}"
- state: running
- env: "CEPH_DAEMON=RGW_USER,RGW_USERNAME={{ ceph_nfs_rgw_user }},RGW_USER_ACCESS_KEY={{ ceph_nfs_rgw_access_key }},RGW_USER_SECRET_KEY={{ ceph_nfs_rgw_secret_key }}"
- volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph"
- when: nfs_obj_gw
-
- name: get user create output
command: docker logs ceph-rgw-user-{{ ansible_hostname }}
always_run: true
- /var/lib/nfs/ganesha
- /var/run/ganesha
-- name: create rgw nfs user
- command: radosgw-admin user create --uid={{ ceph_nfs_rgw_user }} --display-name="RGW NFS User"
- register: rgwuser
- 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
-
-- name: set secret key
- set_fact:
- ceph_nfs_rgw_secret_key: "{{(rgwuser.stdout | from_json)['keys'][0]['secret_key']}}"
- when: nfs_obj_gw
-
- name: generate ganesha configuration file
action: config_template
args:
+++ /dev/null
----
-- name: set config and keys paths
- set_fact:
- rgw_config_keys:
- - "/var/lib/ceph/radosgw/{{ ansible_hostname }}/keyring"
- when: nfs_obj_gw
-
-- name: wait for rgw keyring
- wait_for: path="/var/lib/ceph/radosgw/{{ ansible_hostname }}/keyring"
- when:
- - nfs_obj_gw
- - inventory_hostname == groups[rgw_group_name][0]
-
-- name: stat for config and keys
- local_action: stat path={{ fetch_directory }}/docker_mon_files/{{ item }}
- with_items: "{{ rgw_config_keys }}"
- changed_when: false
- become: false
- failed_when: false
- always_run: true
- register: statconfig
- when:
- - nfs_obj_gw
- - inventory_hostname == groups[rgw_group_name][0]
-
-- name: push ceph files to the ansible server
- fetch:
- src: "{{ item.0 }}"
- dest: "{{ fetch_directory }}/docker_mon_files/var/lib/ceph/radosgw/keyring"
- flat: yes
- with_together:
- - "{{ rgw_config_keys }}"
- - "{{ statconfig.results }}"
- when:
- - nfs_obj_gw
- - item.1.stat.exists == false
- - inventory_hostname == groups[rgw_group_name][0]