Premier commit
This commit is contained in:
commit
518c7ab04b
49 files changed
+1120
No files matched your search
@@ -0,0 +1,40 @@
|
||||
---
|
||||
- name: Installation selon distribution
|
||||
hosts: all
|
||||
become: yes
|
||||
|
||||
tasks:
|
||||
- name: "Set when conditions"
|
||||
set_fact:
|
||||
is_dnf: "{{ ansible_distribution in ['RedHat', 'Rocky', 'Fedora', 'AlmaLinux'] }}"
|
||||
is_apt: "{{ ansible_os_family == 'Debian' }}"
|
||||
is_apk: "{{ ansible_os_family == 'Alpine' }}"
|
||||
is_zypper: "{{ ansible_distribution == 'openSUSE Leap' }}"
|
||||
|
||||
- name: "Update RedHat family"
|
||||
ansible.builtin.dnf:
|
||||
update_cache: yes
|
||||
name: '*'
|
||||
state: latest
|
||||
when: is_dnf
|
||||
|
||||
- name: "Update Debian family"
|
||||
ansible.builtin.apt:
|
||||
update_cache: yes
|
||||
name: "*"
|
||||
state: latest
|
||||
when: is_apt
|
||||
|
||||
- name: "Alpine update"
|
||||
apk:
|
||||
update_cache: yes
|
||||
available: yes
|
||||
upgrade: yes
|
||||
when: is_apk
|
||||
|
||||
- name: "OpenSUSE update"
|
||||
zypper:
|
||||
update_cache: yes
|
||||
name: "*"
|
||||
state: latest
|
||||
when: is_zypper
|
||||
Reference in new issue
Block a user