From c4dcdaa201dddeb5d372889fbb750ae3c40a1a9b Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Mon, 9 Oct 2017 21:34:17 +0200 Subject: [PATCH] nfs: move repository configuration in ceph-nfs role This is something that has nothing to do in `ceph-common`, this is too specific to `ceph-nfs` role. Signed-off-by: Guillaume Abrioux --- .../installs/debian_community_repository.yml | 9 --- .../tasks/installs/debian_dev_repository.yml | 20 ----- .../installs/redhat_community_repository.yml | 12 --- .../tasks/installs/redhat_dev_repository.yml | 20 ----- .../tasks/pre_requisite_non_container.yml | 73 +++++++++++++++++++ 5 files changed, 73 insertions(+), 61 deletions(-) diff --git a/roles/ceph-common/tasks/installs/debian_community_repository.yml b/roles/ceph-common/tasks/installs/debian_community_repository.yml index 10e60dc6d..0e18cd530 100644 --- a/roles/ceph-common/tasks/installs/debian_community_repository.yml +++ b/roles/ceph-common/tasks/installs/debian_community_repository.yml @@ -9,12 +9,3 @@ repo: "deb {{ ceph_stable_repo }} {{ ceph_stable_distro_source | default(ansible_lsb.codename) }} main" state: present changed_when: false - -- name: add nfs-ganesha stable repository - apt_repository: - repo: "deb {{ nfs_ganesha_stable_deb_repo }} {{ ceph_stable_distro_source | default(ansible_lsb.codename) }} main" - state: present - changed_when: false - when: - - nfs_group_name in group_names - - nfs_ganesha_stable diff --git a/roles/ceph-common/tasks/installs/debian_dev_repository.yml b/roles/ceph-common/tasks/installs/debian_dev_repository.yml index c975540f7..586b6771c 100644 --- a/roles/ceph-common/tasks/installs/debian_dev_repository.yml +++ b/roles/ceph-common/tasks/installs/debian_dev_repository.yml @@ -11,23 +11,3 @@ 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 - diff --git a/roles/ceph-common/tasks/installs/redhat_community_repository.yml b/roles/ceph-common/tasks/installs/redhat_community_repository.yml index 5aff95e0b..013f8aa7f 100644 --- a/roles/ceph-common/tasks/installs/redhat_community_repository.yml +++ b/roles/ceph-common/tasks/installs/redhat_community_repository.yml @@ -12,15 +12,3 @@ 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 }}/luminous/$basearch" - when: - - nfs_group_name in group_names - - nfs_ganesha_stable diff --git a/roles/ceph-common/tasks/installs/redhat_dev_repository.yml b/roles/ceph-common/tasks/installs/redhat_dev_repository.yml index c8fd5bdc9..5bf6d2c99 100644 --- a/roles/ceph-common/tasks/installs/redhat_dev_repository.yml +++ b/roles/ceph-common/tasks/installs/redhat_dev_repository.yml @@ -13,26 +13,6 @@ 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 - - name: set_fact ceph_iscsi_repos set_fact: ceph_iscsi_repos: diff --git a/roles/ceph-nfs/tasks/pre_requisite_non_container.yml b/roles/ceph-nfs/tasks/pre_requisite_non_container.yml index 822eff8af..56d505c94 100644 --- a/roles/ceph-nfs/tasks/pre_requisite_non_container.yml +++ b/roles/ceph-nfs/tasks/pre_requisite_non_container.yml @@ -1,4 +1,77 @@ --- +- 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_release }}/$basearch" + when: + - ansible_os_family == 'RedHat' + - nfs_ganesha_stable + - ceph_origin == 'repository' + - ceph_repository == 'community' + +- 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: + - ansible_os_family == 'RedHat' + - nfs_ganesha_dev + - ceph_origin == 'repository' + - ceph_repository == '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: + - ansible_os_family == 'RedHat' + - nfs_ganesha_dev + - ceph_origin == 'repository' + - ceph_repository == 'dev' + +- name: add nfs-ganesha stable repository + apt_repository: + repo: "deb {{ nfs_ganesha_stable_deb_repo }} {{ ceph_stable_distro_source | default(ansible_lsb.codename) }} main" + state: present + changed_when: false + when: + - ansible_os_family == 'Debian' + - nfs_ganesha_stable + - ceph_origin == 'repository' + - ceph_repository == 'community' + +- 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: + - ansible_os_family == 'Debian' + - nfs_ganesha_dev + - ceph_origin == 'repository' + - ceph_repository == '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: + - ansible_os_family == 'Debian' + - nfs_ganesha_dev + - ceph_origin == 'repository' + - ceph_repository == 'dev' + - name: install redhat nfs-ganesha-ceph package package: name: nfs-ganesha-ceph -- 2.39.5