Merge pull request #2015 from ceph/fix_nfs-ganesha-repos

nfs: move repository configuration in ceph-nfs role
pull/2021/head v3.0.0
Sébastien Han 2017-10-10 17:15:33 +02:00 committed by GitHub
commit f6d1be269f
7 changed files with 118 additions and 98 deletions

View File

@ -25,11 +25,11 @@ You can install directly from the source on github by following these steps:
git checkout $branch git checkout $branch
.. _ansible-on-rhel-family:
Ansible on RHEL and CentOS Ansible on RHEL and CentOS
-------------------------- --------------------------
You can acquire Ansible on RHEL and CentOS by installing from You can acquire Ansible on RHEL and CentOS by installing from `Extras <https://access.redhat.com/solutions/912213>`_.
`"Extras"<https://access.redhat.com/solutions/912213>`_.
On RHEL:: On RHEL::
@ -43,8 +43,7 @@ On RHEL::
Ansible on Ubuntu Ansible on Ubuntu
----------------- -----------------
You can acquire Ansible on Ubuntu by using the `Ansible You can acquire Ansible on Ubuntu by using the `Ansible PPA <https://launchpad.net/~ansible/+archive/ubuntu/ansible>`_.
PPA<https://launchpad.net/~ansible/+archive/ubuntu/ansible>`_.
:: ::

View File

@ -9,12 +9,3 @@
repo: "deb {{ ceph_stable_repo }} {{ ceph_stable_distro_source | default(ansible_lsb.codename) }} main" repo: "deb {{ ceph_stable_repo }} {{ ceph_stable_distro_source | default(ansible_lsb.codename) }} main"
state: present state: present
changed_when: false 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

View File

@ -11,23 +11,3 @@
state: present state: present
changed_when: false 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

View File

@ -12,15 +12,3 @@
state: present state: present
gpgkey: "{{ ceph_stable_key }}" gpgkey: "{{ ceph_stable_key }}"
baseurl: "{{ ceph_mirror }}/rpm-{{ ceph_stable_release }}/{{ ceph_stable_redhat_distro }}/$basearch" 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

View File

@ -12,56 +12,3 @@
owner: root owner: root
group: root group: root
backup: yes 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:
- ceph-iscsi-config
- tcmu-runner
when:
- ceph_iscsi_config_dev
- iscsi_gw_group_name in group_names
- name: fetch ceph-iscsi-config red hat development repository
uri:
url: https://shaman.ceph.com/api/repos/{{ item }}/{{ ceph_dev_branch }}/{{ ceph_dev_sha1 }}/{{ ansible_distribution | lower }}/{{ ansible_distribution_major_version }}/repo
return_content: yes
register: ceph_iscsi_config_dev_yum_repo
with_items: "{{ ceph_iscsi_repos }}"
when:
- ceph_iscsi_config_dev
- iscsi_gw_group_name in group_names
- name: configure ceph-iscsi-config red hat development repository
copy:
content: "{{ item.0.content }}"
dest: "/etc/yum.repos.d/{{ item.1 }}-dev.repo"
owner: root
group: root
backup: yes
with_together:
- "{{ ceph_iscsi_config_dev_yum_repo.results }}"
- "{{ ceph_iscsi_repos }}"
when:
- ceph_iscsi_config_dev
- iscsi_gw_group_name in group_names

View File

@ -1,4 +1,43 @@
--- ---
- name: set_fact ceph_iscsi_repos
set_fact:
ceph_iscsi_repos:
- ceph-iscsi-config
- tcmu-runner
when:
- ansible_os_family == 'RedHat'
- ceph_origin == 'repository'
- ceph_repository == 'dev'
- ceph_iscsi_config_dev
- name: fetch ceph-iscsi-config red hat development repository
uri:
url: https://shaman.ceph.com/api/repos/{{ item }}/{{ ceph_dev_branch }}/{{ ceph_dev_sha1 }}/{{ ansible_distribution | lower }}/{{ ansible_distribution_major_version }}/repo
return_content: yes
register: ceph_iscsi_config_dev_yum_repo
with_items: "{{ ceph_iscsi_repos }}"
when:
- ansible_os_family == 'RedHat'
- ceph_origin == 'repository'
- ceph_repository == 'dev'
- ceph_iscsi_config_dev
- name: configure ceph-iscsi-config red hat development repository
copy:
content: "{{ item.0.content }}"
dest: "/etc/yum.repos.d/{{ item.1 }}-dev.repo"
owner: root
group: root
backup: yes
with_together:
- "{{ ceph_iscsi_config_dev_yum_repo.results }}"
- "{{ ceph_iscsi_repos }}"
when:
- ansible_os_family == 'RedHat'
- ceph_origin == 'repository'
- ceph_repository == 'dev'
- ceph_iscsi_config_dev
- name: install redhat ceph iscsi package - name: install redhat ceph iscsi package
package: package:
name: "{{ item }}" name: "{{ item }}"

View File

@ -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 - name: install redhat nfs-ganesha-ceph package
package: package:
name: nfs-ganesha-ceph name: nfs-ganesha-ceph
@ -61,6 +134,7 @@
name: nfs-ganesha name: nfs-ganesha
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: when:
- ansible_os_family == 'Debian'
- (ceph_origin == 'repository' or ceph_origin == 'distro') - (ceph_origin == 'repository' or ceph_origin == 'distro')
- ceph_repository == 'rhcs' - ceph_repository == 'rhcs'
@ -69,6 +143,7 @@
name: nfs-ganesha-ceph name: nfs-ganesha-ceph
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: when:
- ansible_os_family == 'Debian'
- (ceph_origin == 'repository' or ceph_origin == 'distro') - (ceph_origin == 'repository' or ceph_origin == 'distro')
- ceph_repository == 'rhcs' - ceph_repository == 'rhcs'
- nfs_file_gw - nfs_file_gw
@ -78,6 +153,7 @@
name: nfs-ganesha-rgw name: nfs-ganesha-rgw
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}" state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
when: when:
- ansible_os_family == 'Debian'
- (ceph_origin == 'repository' or ceph_origin == 'distro') - (ceph_origin == 'repository' or ceph_origin == 'distro')
- ceph_repository == 'rhcs' - ceph_repository == 'rhcs'
- nfs_obj_gw - nfs_obj_gw