
Use the modern deb822 format [1] for Apt repositories on Ubuntu the same way as in OpenStack Kolla projects, for example in Kayobe [2]. Also this change refactor usage of the deprecated [3] apt-key tool. [1] https://manpages.ubuntu.com/manpages/jammy/en/man5/sources.list.5.html#deb822-style%20format [2] I3f821937b0930a0ac9341178de7ae5123d82b957 [3] https://manpages.ubuntu.com/manpages/jammy/en/man8/apt-key.8.html#deprecation Change-Id: Ic3dd0ce30a8436406a451276bbd94cb5f6f33f9d Signed-off-by: Maksim Malchuk <maksim.malchuk@gmail.com>
82 lines
2.3 KiB
YAML
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: yes
|
|
|
|
- name: Ensure apt keyrings directory exists
|
|
file:
|
|
path: /etc/apt/keyrings
|
|
state: directory
|
|
recurse: yes
|
|
|
|
- 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
|