bs_nix/ansible/dnf-update.yml

21 lines
480 B
YAML

- hosts: '{{ target }}'
gather_facts: true
become: true
remote_user: root
strategy: free
#any_errors_fatal: yes
tasks:
- name: dnf update
dnf:
name: "*"
state: latest
when: ansible_facts['os_family'] == 'RedHat' and ansible_facts ['distribution_major_version'] >= '8'
- name: yum update
yum:
name: "*"
state: latest
when: ansible_facts['os_family'] == 'RedHat' and ansible_facts ['distribution_major_version'] <= '7'