From b352760fd19908419766d13151f61fe463dd0d96 Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Mon, 28 Aug 2017 07:33:10 -0500 Subject: [PATCH] Fedora 26 support This patch adds support for Fedora 26. Depends-On: Ic4ea169908fec86623dbe91859ec524e48683ab7 Change-Id: I590bed829d9e3b7a6df477a00b65bfc10fc64dae --- README.md | 2 +- defaults/main.yml | 2 +- doc/source/faq.rst | 2 +- doc/source/index.rst | 2 +- tasks/rhel7stig/dnf.yml | 39 +++++++++++++++++++++++++++++++++++++-- vars/redhat.yml | 4 ++-- 6 files changed, 43 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3567c2d5..746bf775 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ to systems running the following distributions: * CentOS 7 * Debian Jessie -* Fedora 25 +* Fedora 26 * openSUSE Leap 42.2 and 42.3 * Red Hat Enterprise Linux 7 * SUSE Linux Enterprise 12 (*experimental*) diff --git a/defaults/main.yml b/defaults/main.yml index 74199a75..7f72d177 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -19,7 +19,7 @@ # # * CentOS 7 # * Debian Jessie -# * Fedora 25 +# * Fedora 26 # * openSUSE Leap 42.x # * SUSE Linux Enterprise 12 # * Ubuntu 16.04 Xenial LTS diff --git a/doc/source/faq.rst b/doc/source/faq.rst index 8f41481c..2bffbaca 100644 --- a/doc/source/faq.rst +++ b/doc/source/faq.rst @@ -45,7 +45,7 @@ servers running the following Linux distributions: * CentOS 7 * Debian 8 Jessie -* Fedora 25 +* Fedora 26 * openSUSE Leap 42.2 and 42.3 * Red Hat Enterprise Linux 7 *(partial automated test coverage)* * SUSE Linux Enterprise 12 (*experimental*) diff --git a/doc/source/index.rst b/doc/source/index.rst index fc1b5778..b18ca111 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -90,7 +90,7 @@ Pike * CentOS 7 * Debian 8 Jessie - * Fedora 25 + * Fedora 26 * openSUSE Leap 42.2 and 42.3 * Red Hat Enterprise Linux 7 *(partial automated test coverage)* * SUSE Linux Enterprise 12 (*experimental*) diff --git a/tasks/rhel7stig/dnf.yml b/tasks/rhel7stig/dnf.yml index 25bf3b51..b4a3746d 100644 --- a/tasks/rhel7stig/dnf.yml +++ b/tasks/rhel7stig/dnf.yml @@ -42,9 +42,44 @@ - medium - V-71999 -- name: Enable dnf-automatic timer for automatic package updates +# NOTE(mhayden): Fedora < 26 and CentOS 7 only have dnf-automatic.timer while +# Fedora 26 has dnf-automatic-install.timer. We need to check for which one +# exists on the system. +- name: Check to see which dnf automatic timers are available + shell: "rpm -ql dnf-automatic | grep timer || true" + args: + warn: no + register: dnf_automatic_timers + check_mode: no + changed_when: False + when: + - ansible_os_family | lower == 'redhat' + - ansible_pkg_mgr == 'dnf' + - dnf_automatic_config_check.stat.exists | bool + - security_rhel7_automatic_package_updates | bool + tags: + - packages + - medium + - V-71999 + - skip_ansible_lint + +- name: Set a fact for the proper dnf automatic timer + set_fact: + dnf_automatic_timer: "{{ ('dnf-automatic-install.timer' in dnf_automatic_timers.stdout) | ternary('dnf-automatic-install.timer', 'dnf-automatic.timer') }}" + when: + - ansible_os_family | lower == 'redhat' + - ansible_pkg_mgr == 'dnf' + - dnf_automatic_config_check.stat.exists | bool + - security_rhel7_automatic_package_updates | bool + tags: + - packages + - medium + - V-71999 + - skip_ansible_lint + +- name: Enable dnf automatic timer for automatic package updates systemd: - name: dnf-automatic.timer + name: "{{ dnf_automatic_timer }}" enabled: yes state: started when: diff --git a/vars/redhat.yml b/vars/redhat.yml index 1c5386e3..b900ae3b 100644 --- a/vars/redhat.yml +++ b/vars/redhat.yml @@ -13,9 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -## Variables for CentOS 7, Red Hat Enterprise Linux 7 and Fedora 25. +## Variables for CentOS 7, Red Hat Enterprise Linux 7 and Fedora 26. # The following variables apply only to CentOS 7, Red Hat Enterprise Linux 7 -# and Fedora 25. Deployers should not override these. +# and Fedora 26. Deployers should not override these. # # For more details, see 'vars/main.yml'.