08ed9d9873
With [1] the ceph_yum_repo_url was deprecated in favor of unified ceph_repo_url variable, though it was not fully removed from redhat vars, resulting in "variable not defined" error. Also a type was made for defenition of yum repos at the same patch that's being addressed now. [1] https://review.opendev.org/c/openstack/openstack-ansible-ceph_client/+/929645 Change-Id: I971754edcf7cc58e67b91f726c4f16aa97374bb2
68 lines
2.1 KiB
YAML
68 lines
2.1 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: "{{ item.url }}"
|
|
dest: "{{ item.key }}"
|
|
mode: "0640"
|
|
with_items: "{{ ceph_gpg_keys | selectattr('url', 'defined') }}"
|
|
register: _get_yum_keys
|
|
until: _get_yum_keys is success
|
|
retries: 5
|
|
delay: 2
|
|
when:
|
|
- ceph_pkg_source == 'ceph'
|
|
|
|
- name: Copy Ceph gpg keyfile to the key location
|
|
copy:
|
|
src: "{{ item.src }}"
|
|
dest: "{{ item.key }}"
|
|
mode: "0640"
|
|
with_items: "{{ ceph_gpg_keys | selectattr('src', 'defined') }}"
|
|
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
|
|
register: _add_ceph_keys
|
|
until: _add_ceph_keys is success
|
|
retries: 5
|
|
delay: 2
|
|
|
|
- name: Install required repositories
|
|
yum_repository:
|
|
baseurl: "{{ item.baseurl }}"
|
|
description: "{{ item.description | default(omit) }}"
|
|
enabled: "{{ item.enabled | default(True) }}"
|
|
file: "{{ item.file | default(omit) }}"
|
|
includepkgs: "{{ item.includepkgs | default(omit) }}"
|
|
gpgcheck: "{{ item.gpgcheck | default(omit) }}"
|
|
gpgkey: "{{ item.gpgkey | default(omit) }}"
|
|
name: "{{ item.name }}"
|
|
priority: "{{ item.priority | default(omit) }}"
|
|
state: "{{ item.state | default('present') }}"
|
|
with_items: "{{ ceph_repos }}"
|
|
register: install_repo
|
|
until: install_repo is success
|
|
retries: 5
|
|
delay: 2
|