diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 3677352959586b4419ab5328383f408b9e343685..9acfbad38ec2ab4a1511e69c55c8e7d1d072bde8 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -382,6 +382,7 @@ enable_central_logging: "no" enable_ceph: "no" enable_ceph_mds: "no" enable_ceph_rgw: "no" +enable_ceph_nfs: "no" enable_chrony: "no" enable_cinder: "no" enable_cinder_backup: "yes" diff --git a/ansible/inventory/all-in-one b/ansible/inventory/all-in-one index 226d8ba07f840e43caf44128e746fc176e276e12..eeed4c7c6bf58a0810d9aa997b4ae3c9c7d28028 100644 --- a/ansible/inventory/all-in-one +++ b/ansible/inventory/all-in-one @@ -299,6 +299,9 @@ ceph [ceph-mgr:children] ceph +[ceph-nfs:children] +ceph + [ceph-mon:children] ceph diff --git a/ansible/inventory/multinode b/ansible/inventory/multinode index 58e7d3c56fb826378eb643d15f1700be66643539..6eb956979d5001b6830dbd2893a639bfa3bd8646 100644 --- a/ansible/inventory/multinode +++ b/ansible/inventory/multinode @@ -318,6 +318,9 @@ ceph [ceph-mgr:children] ceph +[ceph-nfs:children] +ceph + [ceph-mon:children] ceph diff --git a/ansible/roles/ceph/defaults/main.yml b/ansible/roles/ceph/defaults/main.yml index abf9e7da71ccbb49c4498c43cee9f942e95074ae..0655c6724a9076a1e06f1846559bfe664ea6f99e 100644 --- a/ansible/roles/ceph/defaults/main.yml +++ b/ansible/roles/ceph/defaults/main.yml @@ -20,6 +20,10 @@ ceph_mgr_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker ceph_mgr_tag: "{{ ceph_tag }}" ceph_mgr_image_full: "{{ ceph_mgr_image }}:{{ ceph_mgr_tag }}" +ceph_nfs_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ ceph_install_type }}-ceph-nfs" +ceph_nfs_tag: "{{ ceph_tag }}" +ceph_nfs_image_full: "{{ ceph_nfs_image }}:{{ ceph_nfs_tag }}" + ceph_osd_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ ceph_install_type }}-ceph-osd" ceph_osd_tag: "{{ ceph_tag }}" ceph_osd_image_full: "{{ ceph_osd_image }}:{{ ceph_osd_tag }}" diff --git a/ansible/roles/ceph/tasks/config.yml b/ansible/roles/ceph/tasks/config.yml index 8fc724b633b58c4c847e16ec000c398beac392fe..52abcae1377a32db4a4357d348a69711032fe492 100644 --- a/ansible/roles/ceph/tasks/config.yml +++ b/ansible/roles/ceph/tasks/config.yml @@ -10,6 +10,7 @@ - "ceph-rgw" - "ceph-mgr" - "ceph-mds" + - "ceph-nfs" - name: Copying over config.json files for services template: @@ -28,6 +29,8 @@ group: "ceph-mgr" - name: "ceph-mds" group: "ceph-mds" + - name: "ceph-nfs" + group: "ceph-nfs" - name: Copying over ceph.conf vars: @@ -44,3 +47,4 @@ - "ceph-rgw" - "ceph-mgr" - "ceph-mds" + - "ceph-nfs" diff --git a/ansible/roles/ceph/tasks/deploy.yml b/ansible/roles/ceph/tasks/deploy.yml index 7026f7621b0669880965efdb31c1b0e2e503c6d8..937c064ad405d5744bb1ce6b56aa50e953552f7f 100644 --- a/ansible/roles/ceph/tasks/deploy.yml +++ b/ansible/roles/ceph/tasks/deploy.yml @@ -12,6 +12,9 @@ - include: start_mgrs.yml when: inventory_hostname in groups['ceph-mgr'] +- include: start_nfss.yml + when: inventory_hostname in groups['ceph-nfs'] + - include: bootstrap_osds.yml when: inventory_hostname in groups['ceph-osd'] diff --git a/ansible/roles/ceph/tasks/pull.yml b/ansible/roles/ceph/tasks/pull.yml index 225e3d15bb6a976149aa28736824caf11e1bf1f7..bf59e2c88354596864d7a0605470578813d25628 100644 --- a/ansible/roles/ceph/tasks/pull.yml +++ b/ansible/roles/ceph/tasks/pull.yml @@ -36,3 +36,11 @@ when: - enable_ceph_mds | bool - inventory_hostname in groups['ceph-mds'] + +- name: Pulling ceph-nfs image + kolla_docker: + action: "pull_image" + common_options: "{{ docker_common_options }}" + image: "{{ ceph_nfs_image_full }}" + when: + - inventory_hostname in groups['ceph-nfs'] diff --git a/ansible/roles/ceph/tasks/start_nfss.yml b/ansible/roles/ceph/tasks/start_nfss.yml new file mode 100644 index 0000000000000000000000000000000000000000..8cf94d4280a082e09b47531c14b4d8dadc60e161 --- /dev/null +++ b/ansible/roles/ceph/tasks/start_nfss.yml @@ -0,0 +1,12 @@ +--- +- name: Starting ceph-nfs container + kolla_docker: + action: "start_container" + common_options: "{{ docker_common_options }}" + image: "{{ ceph_nfs_image_full }}" + name: "ceph_nfs" + volumes: + - "{{ node_config_directory }}/ceph-nfs/:{{ container_config_directory }}/:ro" + - "/etc/localtime:/etc/localtime:ro" + - "/var/run/dbus:/var/run/dbus" + - "kolla_logs:/var/log/kolla/" diff --git a/ansible/roles/ceph/tasks/upgrade.yml b/ansible/roles/ceph/tasks/upgrade.yml index 9e8a43664f7ba35864ead274d442fe4863c74c22..cc703e9ff09dd836965a599bed168444aeb03ba8 100644 --- a/ansible/roles/ceph/tasks/upgrade.yml +++ b/ansible/roles/ceph/tasks/upgrade.yml @@ -19,3 +19,8 @@ when: - enable_ceph_mds | bool - inventory_hostname in groups['ceph-mds'] + +- include: start_nfss.yml + when: + - enable_ceph_nfs | bool + - inventory_hostname in groups['ceph-nfs'] diff --git a/ansible/roles/ceph/templates/ceph-nfs.json.j2 b/ansible/roles/ceph/templates/ceph-nfs.json.j2 new file mode 100644 index 0000000000000000000000000000000000000000..05d88924fca031922bbae6734a6cd4b911f8e3b5 --- /dev/null +++ b/ansible/roles/ceph/templates/ceph-nfs.json.j2 @@ -0,0 +1,24 @@ +{ + "command": "/usr/bin/ganesha.nfsd -f /etc/ganesha/ganesha.conf", + "config_files": [ + { + "source": "{{ container_config_directory }}/ganesha.conf", + "dest": "/etc/ganesha/ganesha.conf", + "owner": "ceph", + "perm": "0600" + }, + { + "source": "{{ container_config_directory }}/ceph.conf", + "dest": "/etc/ceph/ceph.conf", + "owner": "ceph", + "perm": "0600" + }, + { + "source": "{{ container_config_directory }}/ceph.client.admin.keyring", + "dest": "/etc/ceph/ceph.client.admin.keyring", + "owner": "ceph", + "perm": "0600", + "optional": true + } + ] +} diff --git a/ansible/roles/ceph/templates/ganesha.conf.j2 b/ansible/roles/ceph/templates/ganesha.conf.j2 new file mode 100644 index 0000000000000000000000000000000000000000..ad86afbaf780987f5b362bc777cdccf1c00544a1 --- /dev/null +++ b/ansible/roles/ceph/templates/ganesha.conf.j2 @@ -0,0 +1,27 @@ +EXPORT +{ + Export_id=1; + + Path = "/"; + + Pseudo = /cephfs; + + Access_Type = RW; + + Protocols = 4; + + Transports = TCP; + + FSAL { + Name = CEPH; + User_Id = "admin"; + } +} + +LOG { + Facility { + name = FILE; + destination = "/var/log/kolla/ceph/ceph-nfs.log"; + enable = active; + } +} diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml index 86401ca3175be22d174c7edcf1fa9a17d1fe7a53..93d6495997e7c348956c63945cdb6f6a25ee20a7 100644 --- a/etc/kolla/globals.yml +++ b/etc/kolla/globals.yml @@ -144,6 +144,7 @@ kolla_internal_vip_address: "10.10.10.254" #enable_ceph: "no" #enable_ceph_mds: "no" #enable_ceph_rgw: "no" +#enable_ceph_nfs: "no" #enable_chrony: "no" #enable_cinder: "no" #enable_cinder_backup: "yes" diff --git a/releasenotes/notes/implement-ceph-nfs-ff8f9635c365923f.yaml b/releasenotes/notes/implement-ceph-nfs-ff8f9635c365923f.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4f27e71a9482ce7bb49b56fc8ffaf14c5a624c68 --- /dev/null +++ b/releasenotes/notes/implement-ceph-nfs-ff8f9635c365923f.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Implement ceph-nfs service, Nfs-ganesha can be used as a proxy when mounting + ceph file shares.