bs_nix/ansible/dnf-update.yml

20 lines
453 B
YAML
Raw Normal View History

2021-03-12 10:03:10 +00:00
- hosts: '{{ target }}'
2021-01-25 08:17:08 +00:00
gather_facts: true
become: true
2021-01-29 22:04:26 +00:00
remote_user: root
2021-01-25 08:17:08 +00:00
strategy: free
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'