openstack-ansible-ceph_client/tasks/ceph_preinstall_dnf.yml

93 lines
2.7 KiB
YAML

---
# Copyright 2017 Marc Gariépy <gariepy.marc@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Download EPEL gpg keys
get_url:
url: "{{ ceph_centos_epel_key }}"
dest: /etc/pki/rpm-gpg
mode: "0640"
register: _get_yum_keys
until: _get_yum_keys is success
retries: 5
delay: 2
- name: Install EPEL gpg keys
rpm_key:
key: "/etc/pki/rpm-gpg/{{ ceph_centos_epel_key.split('/')[-1] }}"
state: present
- name: Install the EPEL repository
yum_repository:
name: ceph-client-deps
baseurl: "{{ ceph_centos_epel_mirror ~ '/' ~ ansible_facts['distribution_major_version'] ~ '/Everything/' ~ ansible_facts['architecture'] }}"
description: "Extra Packages for Enterprise Linux {{ ansible_facts['distribution_major_version'] }} - $basearch"
gpgcheck: yes
gpgkey: "file:///etc/pki/rpm-gpg/{{ ceph_centos_epel_key.split('/')[-1] }}"
enabled: yes
state: present
includepkgs: 'lttng-ust*, userspace-rcu, libbabeltrace, leveldb, liboath, fmt, thrift'
when:
- ansible_facts['pkg_mgr'] == 'dnf'
register: install_epel_repo
until: install_epel_repo is success
retries: 5
delay: 2
- name: Copy Ceph gpg keyfile to the key location
copy:
src: "gpg/{{ item.key | basename }}"
dest: "{{ item.key }}"
mode: '0644'
with_items: "{{ ceph_gpg_keys }}"
when:
- ceph_pkg_source == 'ceph'
- name: Install Ceph gpg keys
rpm_key:
key: "{{ key['key'] }}"
fingerprint: "{{ key['fingerprint'] | default(omit) }}"
state: "{{ key['state'] | default('present') }}"
with_items: "{{ ceph_gpg_keys }}"
loop_control:
loop_var: key
when:
- ceph_pkg_source == 'ceph'
register: _add_ceph_keys
until: _add_ceph_keys is success
retries: 5
delay: 2
- name: Add ceph repo
yum_repository:
name: ceph
description: "Ceph packages for $basearch"
file: ceph
baseurl: "{{ ceph_yum_repo_url }}/$basearch"
gpgcheck: yes
enabled: yes
priority: 50
state: present
- name: Add ceph noarch repo
yum_repository:
name: ceph-noarch
description: "Ceph noarch packages"
file: ceph
baseurl: "{{ ceph_yum_repo_url }}/noarch"
gpgcheck: yes
enabled: yes
priority: 50
state: present