---
- name: Ensure yum repos directory exists
  file:
    path: /etc/yum.repos.d/
    state: directory
    recurse: yes
  become: True

- name: Install centos-release-ceph
  dnf:
    name: "centos-release-ceph-{{ cephadm_ceph_release }}"
  become: True
  when: cephadm_use_package_from_distribution

- name: Enable Ceph base yum repository
  yum_repository:
    name: "{{ item.shortname }}"
    description: "{{ item.name }}"
    baseurl: "{{ item.url }}"
    gpgkey: "{{ cephadm_ceph_rpm_gpg_key }}"
  loop: "{{ cephadm_ceph_rpm_repos }}"
  become: True
  when: not cephadm_use_package_from_distribution

- name: Install cephadm
  dnf:
    name: "cephadm"
    install_weak_deps: False
  become: True
