Deploy Zun with Cinder Ceph support

Enables zun to access cinder volumes when cinder is configured to use
external ceph.
Copies ceph config file and ceph cinder keyring to /etc/ceph in
zun_compute container.

Closes-Bug: 1848934
Change-Id: Ie56868d5e9ed37a9274b8cbe65895f3634b895c8
(cherry picked from commit eb7e0f6fdac86ea9501b98e6e71554b024bffe96)
This commit is contained in:
Buddhika Sanjeewa 2022-01-14 14:42:20 +00:00 committed by Mark Goddard
parent faad14e614
commit 24652ab2aa
3 changed files with 79 additions and 0 deletions

View File

@ -16,6 +16,25 @@ docker_yum_gpgkey: "{{ docker_yum_url }}/gpg"
docker_yum_gpgcheck: true
docker_yum_package: "docker-ce"
ceph_version: "pacific"
epel_version: "8"
ceph_url: "https://download.ceph.com"
# Ceph APT repository configuration.
ceph_apt_url: "{{ ceph_url }}/debian-{{ ceph_version }}/"
ceph_apt_repo: "deb {{ ceph_apt_url }} {{ ansible_facts.distribution_release }} main"
ceph_apt_key_file: "{{ ceph_url }}/keys/release.gpg"
ceph_apt_key_id: "460F3994"
ceph_apt_package: "ceph-common"
# Ceph Yum repository configuration.
ceph_yum_url: "{{ ceph_url }}/rpm-{{ ceph_version }}/"
ceph_yum_baseurl: "{{ ceph_yum_url }}el{{ epel_version }}/$basearch/"
ceph_yum_gpgkey: "{{ ceph_url }}/keys/release.asc"
ceph_yum_gpgcheck: true
ceph_yum_package: "ceph-common"
epel_yum_package: "epel-release"
customize_etc_hosts: True
create_kolla_user: True

View File

@ -9,3 +9,8 @@
when:
- containerd_configure_for_zun|bool
- "'zun-cni-daemon' in group_names"
- include_tasks: configure-ceph-for-zun.yml
when:
- zun_configure_for_cinder_ceph | bool
- "'zun-compute' in group_names"

View File

@ -0,0 +1,55 @@
---
- name: Install ceph-common
block:
- block:
- name: Install ceph apt gpg key
apt_key:
url: "{{ ceph_apt_key_file }}"
id: "{{ ceph_apt_key_id }}"
state: present
become: True
- name: Enable ceph apt repository
apt_repository:
repo: "{{ ceph_apt_repo }}"
filename: ceph
become: True
- name: Install apt packages
package:
name: "{{ ceph_apt_package }}"
state: present
become: True
when: ansible_facts.os_family == 'Debian'
- block:
- name: Enable ceph yum repository
yum_repository:
name: ceph
description: Ceph main Repository
baseurl: "{{ ceph_yum_baseurl }}"
gpgcheck: "{{ ceph_yum_gpgcheck | bool }}"
gpgkey: "{{ ceph_yum_gpgkey }}"
become: True
- name: Enable epel yum repository
package:
name: "{{ epel_yum_package }}"
state: present
become: True
- name: Install ceph rpm gpg key
rpm_key:
state: present
key: "{{ ceph_yum_gpgkey }}"
become: True
when:
- ceph_yum_gpgcheck | bool
- name: Install RPM packages
package:
name: "{{ ceph_yum_package }}"
state: present
enablerepo: epel
become: True
when: ansible_facts.os_family == 'RedHat'