ceph-ansible/roles/ceph-nfs/tasks/pre_requisite_non_container...

92 lines
3.3 KiB
YAML
Raw Normal View History

---
- name: debian based systems - repo handling
when: ceph_origin == 'repository'
block:
- name: stable repos specific tasks
when:
- nfs_ganesha_stable | bool
- ceph_repository == 'community'
block:
- name: add nfs-ganesha stable repository
apt_repository:
repo: "deb {{ nfs_ganesha_stable_deb_repo }} {{ ceph_stable_distro_source | default(ansible_facts['distribution_release']) }} main"
state: present
update_cache: no
register: add_ganesha_apt_repo
- name: update apt cache
apt:
update_cache: yes
register: update_ganesha_apt_cache
retries: 5
delay: 2
until: update_ganesha_apt_cache is success
when: add_ganesha_apt_repo is changed
- name: debian based systems - dev repos specific tasks
when:
- nfs_ganesha_dev | bool
- ceph_repository == 'dev'
block:
- name: fetch nfs-ganesha development repository
uri:
url: https://shaman.ceph.com/api/repos/nfs-ganesha/next/latest/{{ ansible_facts['distribution'] | lower }}/{{ ansible_facts['distribution_release'] }}/flavors/{{ nfs_ganesha_flavor }}/repo
return_content: yes
register: nfs_ganesha_dev_apt_repo
- 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
- name: debain based systems - install required packages
block:
- name: debian based systems- non-rhcs installation
when:
- (ceph_origin == 'repository' or ceph_origin == 'distro')
- ceph_repository != 'rhcs'
block:
- name: install nfs rgw/cephfs gateway - debian
apt:
name: ['nfs-ganesha-rgw', 'radosgw']
allow_unauthenticated: yes
register: result
until: result is succeeded
when: nfs_obj_gw | bool
- name: install nfs rgw/cephfs gateway - debian
apt:
name: nfs-ganesha-ceph
allow_unauthenticated: yes
register: result
until: result is succeeded
when: nfs_file_gw | bool
- name: debian based systems - rhcs installation
when:
- (ceph_origin == 'repository' or ceph_origin == 'distro')
- ceph_repository == 'rhcs'
block:
- name: install red hat storage nfs gateway for debian
apt:
name: nfs-ganesha
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
register: result
until: result is succeeded
- name: install red hat storage nfs file gateway
apt:
name: nfs-ganesha-ceph
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
register: result
until: result is succeeded
when: nfs_file_gw | bool
- name: install red hat storage nfs obj gateway
apt:
name: nfs-ganesha-rgw
state: "{{ (upgrade_ceph_packages|bool) | ternary('latest','present') }}"
register: result
until: result is succeeded
when: nfs_obj_gw | bool