ansible-collection-kolla/roles/baremetal/tasks/configure-ceph-for-zun.yml
Michal Nasiadka c4a1dcd3c7 Adapt code in preparation for ansible-lint bump
Rename True/False to true/false
Fix permissions values

Change-Id: I75be15fd24aeedf54bb22b9744bc0ee498a62645
2024-10-09 11:27:12 +02:00

82 lines
2.3 KiB
YAML

---
- name: Install ceph-common
block:
- block:
- name: Ensure apt sources list directory exists
file:
path: /etc/apt/sources.list.d
state: directory
recurse: true
- name: Ensure apt keyrings directory exists
file:
path: /etc/apt/keyrings
state: directory
recurse: true
- name: Install ceph apt gpg key
get_url:
url: "{{ ceph_apt_key_file }}"
dest: "/etc/apt/keyrings/ceph.gpg"
mode: "0644"
force: true
- name: Ensure old ceph repository absent
file:
path: /etc/apt/sources.list.d/ceph.list
state: absent
# TODO(mmalchuk): replace with ansible.builtin.deb822_repository module
# when all stable releases moves to the ansible-core >= 2.15
- name: Enable ceph apt repository
copy:
dest: /etc/apt/sources.list.d/ceph.sources
content: |
# Ansible managed
Types: deb
URIs: {{ ceph_apt_url }}
Suites: {{ ansible_facts.distribution_release }}
Components: main
Signed-by: /etc/apt/keyrings/ceph.gpg
mode: "0644"
- name: Install apt packages
apt:
name: "{{ ceph_apt_package }}"
state: present
update_cache: true
when: ansible_facts.os_family == 'Debian'
become: true
- 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 }}"
- name: Enable epel yum repository
package:
name: "{{ epel_yum_package }}"
state: present
- name: Install ceph rpm gpg key
rpm_key:
state: present
key: "{{ ceph_yum_gpgkey }}"
when:
- ceph_yum_gpgcheck | bool
- name: Install RPM packages
package:
name: "{{ ceph_yum_package }}"
state: present
enablerepo: epel
when: ansible_facts.os_family == 'RedHat'
become: true