Add CentOS 8 support

Change-Id: I8eb7b1ce7cadc910386cfb8bf1d9b41194b2ecdd
This commit is contained in:
Dmitriy Rabotyagov 2020-06-20 10:06:05 +03:00
parent 15a0be8cbb
commit 438e946a06
3 changed files with 43 additions and 0 deletions

View File

@ -157,6 +157,8 @@ systemd_networkd_update_initramfs: "{{ _systemd_networkd_update_initramfs | defa
systemd_networkd_distro_packages: "{{ _systemd_networkd_distro_packages | default([]) }}" systemd_networkd_distro_packages: "{{ _systemd_networkd_distro_packages | default([]) }}"
systemd_networkd_epel_mirror: "{{ centos_epel_mirror | default('http://download.fedoraproject.org/pub/epel') }}"
# The systemd networkd service can be used to set specific link configuration options. # The systemd networkd service can be used to set specific link configuration options.
# For more information on all of the possible configuration see # For more information on all of the possible configuration see
# https://www.freedesktop.org/software/systemd/man/systemd.link.html # https://www.freedesktop.org/software/systemd/man/systemd.link.html

View File

@ -26,12 +26,30 @@
tags: tags:
- always - always
- name: Install the EPEL repository
yum_repository:
name: epel-networkd
baseurl: "{{ systemd_networkd_epel_mirror ~ '/' ~ ansible_distribution_major_version ~ '/Everything/' ~ ansible_architecture }}"
description: 'Extra Packages for Enterprise Linux $releasever - $basearch'
gpgcheck: yes
enabled: yes
state: present
includepkgs: 'systemd-networkd'
when:
- ansible_os_family | lower == 'redhat'
- ansible_distribution_major_version is version('8', '>=')
register: install_epel_repo
until: install_epel_repo is success
retries: 5
delay: 2
- name: Install networkd distro packages - name: Install networkd distro packages
package: package:
name: "{{ systemd_networkd_distro_packages }}" name: "{{ systemd_networkd_distro_packages }}"
state: "present" state: "present"
update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}" update_cache: "{{ (ansible_pkg_mgr == 'apt') | ternary('yes', omit) }}"
cache_valid_time: "{{ (ansible_pkg_mgr == 'apt') | ternary(600, omit) }}" cache_valid_time: "{{ (ansible_pkg_mgr == 'apt') | ternary(600, omit) }}"
enablerepo: "{{ systemd_networkd_enablerepo | default(omit) }}"
when: when:
- systemd_networkd_distro_packages | length > 0 - systemd_networkd_distro_packages | length > 0
register: install_packages register: install_packages

23
vars/redhat-8.yml Normal file
View File

@ -0,0 +1,23 @@
---
# Copyright 2020, VEXXHOST Inc.
#
# 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.
_systemd_networkd_distro_packages:
- systemd-networkd
_systemd_resolved_available: false
_systemd_networkd_update_initramfs: "dracut -f"
systemd_networkd_enablerepo: epel