From: Guillaume Abrioux Date: Mon, 9 Oct 2017 15:10:39 +0000 (+0200) Subject: nfs: move packages installation to own role X-Git-Tag: v3.0.0rc19^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=9e8204d9e8dfb899bafd6b88107d221891e9a066;p=ceph-ansible.git nfs: move packages installation to own role Make role `ceph-nfs` handling itself the installation of nfs packages. Signed-off-by: Guillaume Abrioux --- diff --git a/roles/ceph-common/tasks/installs/install_debian_packages.yml b/roles/ceph-common/tasks/installs/install_debian_packages.yml index 443da199e..46d65b665 100644 --- a/roles/ceph-common/tasks/installs/install_debian_packages.yml +++ b/roles/ceph-common/tasks/installs/install_debian_packages.yml @@ -27,28 +27,3 @@ update_cache: yes when: - rgw_group_name in group_names - -- name: install jemalloc for debian - apt: - name: libjemalloc1 - state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" - update_cache: yes - when: - - nfs_group_name in group_names - -- 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 diff --git a/roles/ceph-common/tasks/installs/install_debian_rhcs_packages.yml b/roles/ceph-common/tasks/installs/install_debian_rhcs_packages.yml index 753b87e0c..69bcf18ee 100644 --- a/roles/ceph-common/tasks/installs/install_debian_rhcs_packages.yml +++ b/roles/ceph-common/tasks/installs/install_debian_rhcs_packages.yml @@ -40,26 +40,3 @@ state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" when: - client_group_name in group_names - -- name: install red hat storage nfs gateway for debian - apt: - 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 diff --git a/roles/ceph-common/tasks/installs/install_redhat_packages.yml b/roles/ceph-common/tasks/installs/install_redhat_packages.yml index 291d1cca4..c431a616f 100644 --- a/roles/ceph-common/tasks/installs/install_redhat_packages.yml +++ b/roles/ceph-common/tasks/installs/install_redhat_packages.yml @@ -8,7 +8,7 @@ - ansible_distribution == 'RedHat' - name: install centos dependencies - package: + yum: name: "{{ item }}" state: present with_items: "{{ centos_package_dependencies }}" @@ -62,27 +62,3 @@ state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" when: - rgw_group_name in group_names - -- name: install redhat nfs-ganesha-ceph package - package: - name: nfs-ganesha-ceph - when: - - nfs_group_name in group_names - - nfs_file_gw - -- name: install nfs cephfs gateway - package: - name: nfs-ganesha-ceph - when: - - nfs_group_name in group_names - - nfs_file_gw - -- name: install redhat nfs-ganesha-rgw and ceph-radosgw packages - package: - name: "{{ item }}" - with_items: - - nfs-ganesha-rgw - - ceph-radosgw - when: - - nfs_group_name in group_names - - nfs_obj_gw diff --git a/roles/ceph-common/tasks/installs/redhat_community_repository.yml b/roles/ceph-common/tasks/installs/redhat_community_repository.yml index 8d261e5dd..5aff95e0b 100644 --- a/roles/ceph-common/tasks/installs/redhat_community_repository.yml +++ b/roles/ceph-common/tasks/installs/redhat_community_repository.yml @@ -20,8 +20,7 @@ gpgcheck: yes state: present gpgkey: "{{ ceph_stable_key }}" - baseurl: "{{ ceph_mirror }}/nfs-ganesha/rpm-{{ nfs_ganesha_stable_branch }}/{{ ceph_stable_release }}/$basearch" + baseurl: "{{ ceph_mirror }}/nfs-ganesha/rpm-{{ nfs_ganesha_stable_branch }}/luminous/$basearch" when: - nfs_group_name in group_names - nfs_ganesha_stable - diff --git a/roles/ceph-nfs/tasks/pre_requisite_non_container.yml b/roles/ceph-nfs/tasks/pre_requisite_non_container.yml index 88e281be0..822eff8af 100644 --- a/roles/ceph-nfs/tasks/pre_requisite_non_container.yml +++ b/roles/ceph-nfs/tasks/pre_requisite_non_container.yml @@ -1,4 +1,87 @@ --- +- name: install redhat nfs-ganesha-ceph package + package: + name: nfs-ganesha-ceph + when: + - nfs_file_gw + - ansible_os_family == 'RedHat' + +- name: install nfs cephfs gateway + package: + name: nfs-ganesha-ceph + when: + - nfs_file_gw + - ansible_os_family == 'RedHat' + +- name: install redhat nfs-ganesha-rgw and ceph-radosgw packages + package: + name: "{{ item }}" + with_items: + - nfs-ganesha-rgw + - ceph-radosgw + when: + - nfs_obj_gw + - ansible_os_family == 'RedHat' + +- name: install jemalloc for debian + apt: + name: libjemalloc1 + state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" + update_cache: yes + when: + - (ceph_origin == 'repository' or ceph_origin == 'distro') + - ceph_repository != 'rhcs' + - ansible_os_family == 'Debian' + +# debian installation +- name: install nfs cephfs gateway + package: + name: nfs-ganesha-ceph + when: + - (ceph_origin == 'repository' or ceph_origin == 'distro') + - ceph_repository != 'rhcs' + - ansible_os_family == 'Debian' + - nfs_file_gw + +- name: install nfs rgw gateway + package: + name: "{{ item }}" + with_items: + - nfs-ganesha-rgw + - radosgw + when: + - (ceph_origin == 'repository' or ceph_origin == 'distro') + - ceph_repository != 'rhcs' + - ansible_os_family == 'Debian' + - nfs_obj_gw + +# debian_rhcs installation +- name: install red hat storage nfs gateway for debian + apt: + name: nfs-ganesha + state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" + when: + - (ceph_origin == 'repository' or ceph_origin == 'distro') + - ceph_repository == 'rhcs' + +- name: install red hat storage nfs file gateway + apt: + name: nfs-ganesha-ceph + state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" + when: + - (ceph_origin == 'repository' or ceph_origin == 'distro') + - ceph_repository == 'rhcs' + - 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: + - (ceph_origin == 'repository' or ceph_origin == 'distro') + - ceph_repository == 'rhcs' + - nfs_obj_gw + # NOTE (leseb): we use root:ceph for permissions since ganesha # does not have the right selinux context to read ceph directories. - name: create rados gateway and ganesha directories