Premier commit
This commit is contained in:
commit
518c7ab04b
49 files changed
+1120
No files matched your search
@@ -0,0 +1,52 @@
|
||||
---
|
||||
- name: Installation selon distribution
|
||||
hosts: all
|
||||
become: yes
|
||||
|
||||
tasks:
|
||||
|
||||
- name: "Debug Environnement"
|
||||
ansible.builtin.debug:
|
||||
msg: "ansible_os_family : {{ansible_os_family}} ; ansible_distribution : {{ansible_distribution}} ; ansible_distribution_major_version : {{ansible_distribution_major_version}} ; ansible_distribution_release : {{ansible_distribution_release}}"
|
||||
|
||||
- name: "Install python3-dnf"
|
||||
ansible.builtin.shell:
|
||||
cmd: dnf -y install python3-dnf
|
||||
when: (ansible_distribution == "Fedora")
|
||||
|
||||
- name: "Update RedHat family"
|
||||
block:
|
||||
- name: "Update system"
|
||||
ansible.builtin.dnf:
|
||||
update_cache: yes
|
||||
name: '*'
|
||||
state: latest
|
||||
- name: "Display message"
|
||||
ansible.builtin.debug:
|
||||
msg: "RedHat family"
|
||||
when: (ansible_distribution == "RedHat") or
|
||||
(ansible_distribution == "Rocky") or
|
||||
(ansible_distribution == "Fedora") or
|
||||
(ansible_distribution == "AlmaLinux")
|
||||
|
||||
- name: "Update Debian family"
|
||||
ansible.builtin.apt:
|
||||
update_cache: yes
|
||||
name: "*"
|
||||
state: latest
|
||||
when: (ansible_distribution == " Debian ") or
|
||||
(ansible_distribution == "Debian")
|
||||
|
||||
- name: "Alpine update"
|
||||
apk:
|
||||
update_cache: yes
|
||||
available: yes
|
||||
upgrade: yes
|
||||
when: (ansible_distribution == "Alpine")
|
||||
|
||||
- name: "OpenSUSE update"
|
||||
zypper:
|
||||
update_cache: yes
|
||||
name: "*"
|
||||
state: latest
|
||||
when: (ansible_distribution == "openSUSE Leap")
|
||||
Reference in new issue
Block a user