You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2022/07/27 14:59:17 UTC
[airavata] 02/03: Ansible: fixing dnf cron setup
This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata.git
commit c0dc2e073415f5c234f1e81295f7c62325d9d3db
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed Jul 27 10:58:47 2022 -0400
Ansible: fixing dnf cron setup
---
.../roles/env_setup/tasks/files/dnf-cron.conf | 2 +-
dev-tools/ansible/roles/env_setup/tasks/main.yml | 56 +++++++++++-----------
2 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/dev-tools/ansible/roles/env_setup/tasks/files/dnf-cron.conf b/dev-tools/ansible/roles/env_setup/tasks/files/dnf-cron.conf
index 7fe6949be0..bd38ef404d 100644
--- a/dev-tools/ansible/roles/env_setup/tasks/files/dnf-cron.conf
+++ b/dev-tools/ansible/roles/env_setup/tasks/files/dnf-cron.conf
@@ -72,7 +72,7 @@ group_package_types = mandatory, default
# -4: critical
# -3: critical+errors
# -2: critical+errors+warnings (default)
-debuglevel = -2
+debuglevel = 2
# skip_broken = True
mdpolicy = group:main
diff --git a/dev-tools/ansible/roles/env_setup/tasks/main.yml b/dev-tools/ansible/roles/env_setup/tasks/main.yml
index 44645cdd46..eac347e29f 100644
--- a/dev-tools/ansible/roles/env_setup/tasks/main.yml
+++ b/dev-tools/ansible/roles/env_setup/tasks/main.yml
@@ -34,11 +34,6 @@
become: yes
when: ansible_os_family == "RedHat"
-- name: Install Firewalld (Rocky)
- dnf: name=firewalld
- become: yes
- when: ansible_os_family == "Rocky"
-
- name: Install Firewalld (Debian)
apt: name=firewalld state=latest update_cache=yes
become: yes
@@ -62,7 +57,7 @@
firewalld: port="22/tcp"
zone=public permanent=true state=enabled immediate=yes
become: yes
- when: ansible_os_family == "RedHat" or ansible_os_family == "Rocky"
+ when: ansible_os_family == "RedHat"
# Issues with firewalld module on Ubuntu https://github.com/ansible/ansible/issues/24855
# So as workaround, just calling firewall-cmd directly for now
@@ -78,33 +73,38 @@
# Automatic security updates installation
-# TODO: switch to dnf-automatic for Rocky Linux
-# - name: Install yum-cron, yum-utils (RedHat)
-# yum: name={{ item }} state=latest update_cache=yes
-# become: yes
-# when: ansible_os_family == "RedHat"
-# with_items:
-# - yum-cron
-# - yum-utils
-
-# - name: Copy yum-cron.conf config file
-# copy:
-# src: yum-cron.conf
-# dest: /etc/yum/yum-cron.conf
-# backup: yes
-# become: yes
-# when: ansible_os_family == "RedHat"
-
-- name: Copy dnf-cron.conf config file (RedHat or Rocky)
+- name: Install yum-cron, yum-utils (CentOS)
+ yum: name={{ item }} state=latest update_cache=yes
+ become: yes
+ when: ansible_os_family == "RedHat" and ansible_distribution == "CentOS"
+ with_items:
+ - yum-cron
+ - yum-utils
+
+- name: Copy yum-cron.conf config file (CentOS)
copy:
- src: dnf-cron.conf
- dest: /etc/dnf/automatic.conf
+ src: yum-cron.conf
+ dest: /etc/yum/yum-cron.conf
backup: yes
become: yes
- when: ansible_os_family == "Rocky"
+ when: ansible_os_family == "RedHat" and ansible_distribution == "CentOS"
- name: Enable and start yum-cron
service: name=yum-cron state=started enabled=yes daemon_reload=yes
become: yes
- when: ansible_os_family == "RedHat"
+ when: ansible_os_family == "RedHat" and ansible_distribution == "CentOS"
+
+- name: Copy dnf-cron.conf config file (Rocky)
+ copy:
+ src: dnf-cron.conf
+ dest: /etc/dnf/automatic.conf
+ backup: yes
+ become: yes
+ when: ansible_os_family == "RedHat" and ansible_distribution == "Rocky"
+
+- name: Enable and start dnf-cron (Rocky)
+ service: name=dnf-automatic.timer enabled=yes daemon_reload=yes
+ become: yes
+ when: ansible_os_family == "RedHat" and ansible_distribution == "Rocky"
+
...