]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
nfs-ganesha: add dev, stable, and rhcs nfs-ganesha's for ceph-nfs role
authorAli Maredia <amaredia@redhat.com>
Mon, 21 Aug 2017 12:38:21 +0000 (08:38 -0400)
committerAli Maredia <amaredia@redhat.com>
Fri, 8 Sep 2017 13:13:20 +0000 (09:13 -0400)
Signed-off-by: Ali Maredia <amaredia@redhat.com>
13 files changed:
group_vars/all.yml.sample
group_vars/nfss.yml.sample
group_vars/rhcs.yml.sample
roles/ceph-common/tasks/installs/debian_community_repository.yml
roles/ceph-common/tasks/installs/debian_dev_repository.yml
roles/ceph-common/tasks/installs/install_debian_enterprise_packages.yml
roles/ceph-common/tasks/installs/install_debian_packages.yml
roles/ceph-common/tasks/installs/install_redhat_packages.yml
roles/ceph-common/tasks/installs/redhat_community_repository.yml
roles/ceph-common/tasks/installs/redhat_dev_repository.yml
roles/ceph-defaults/defaults/main.yml
roles/ceph-nfs/defaults/main.yml
roles/ceph-nfs/tasks/pre_requisite.yml

index 17bcda687519df2e9929d8c29aea9f36c1599d26..22529125daa6ecf6d23f5d60d3eb21ba16961562 100644 (file)
@@ -138,6 +138,11 @@ dummy:
 #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
@@ -194,6 +199,11 @@ dummy:
 #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
@@ -383,13 +393,17 @@ dummy:
 #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 #
index 011f0cc2519f9ab9af45ad47e6b4a0851956823e..6f98a0c54f816b4ae58a50e12dd98a8d54e9078f 100644 (file)
@@ -15,14 +15,20 @@ dummy:
 
 #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 #
@@ -54,24 +60,6 @@ dummy:
 #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 #
 ##########
index 24093b9c07cbd43ae0ed4c3a0e8210f091c51928..ee92c71df54a0e9aec9840ca283ddc670cdb6b9d 100644 (file)
@@ -138,6 +138,11 @@ ceph_repository: rhcs
 #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
@@ -194,6 +199,11 @@ ceph_repository: rhcs
 #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
@@ -383,13 +393,17 @@ ceph_repository: rhcs
 #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 #
index 3996416a4ab703d8386261448f71448f5998317a..10e60dc6db8a74e5155572a917eb290fb4e45fd8 100644 (file)
     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
index e37e2ffe34de7b0cb2fc6749cbbfc2ce2ecb4041..b19501e3a4e01785a834cc049fcc167a52bb0f03 100644 (file)
     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
+
index 1aa67ea2bcaf23aeec6d65362e0b418c41684496..5dd37863ce8df637bf2d7f0eba0d29e1470437a0 100644 (file)
 
 - 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
index 9797aaf702bc1459aebae5ee410422f0c8675350..076e839b4201730de4dc69dacf9cc5a4526261d2 100644 (file)
   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:
index 51e07c3f18d857d04c2b8cc6c77932311b4b3308..0688b3db404e7b6d5e5bbb0dc254e9a60e4c2b59 100644 (file)
     - 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:
index 013f8aa7fa8dbfc2e973d21590b3343bbff43a6f..2928dc0d027ddb404b33235b50c0c4e3d520a8cc 100644 (file)
     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
+
index 6bc4b065b3dc1e710ee0ad8f360159275dd0a4b6..989a604ac2d4c87fe91b5662668f3b145d7685d6 100644 (file)
     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
+
index e342633809dec63490255cdc81abcfc864a3d5f4..6d973677b4d1f18130e8ba7a52e75e2ab45dea93 100644 (file)
@@ -130,6 +130,11 @@ ceph_stable_key: https://download.ceph.com/keys/release.asc
 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
@@ -186,6 +191,11 @@ ceph_rhcs_repository_path: "{{ ceph_stable_rh_storage_repository_path | default(
 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
@@ -375,13 +385,17 @@ handler_health_mds_check_delay: 10
 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 #
index f31463d5d73d05ec67a2aff455065592a2776e39..831deb52a4dc0e800b73ddb41ce0a1642020e7f0 100644 (file)
@@ -7,14 +7,20 @@
 
 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 #
@@ -47,23 +53,6 @@ ceph_nfs_rgw_user: "cephnfs"
 #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 #
 ##########
index ad19b4be358171bc97f346de9f7a935d81c31378..8b8722b48f1fecf62c199f897fecd2d11e82d75c 100644 (file)
@@ -1,29 +1,36 @@
 ---
-- 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
@@ -33,7 +40,6 @@
     owner: "root"
     group: "root"
     mode: "0644"
-    config_overrides: "{{ ganesha_conf_overrides }}"
     config_type: ini
 
 - name: start nfs gateway service