Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b7753e79b9 |
@@ -1,15 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Test de connexion
|
|
||||||
hosts: all
|
|
||||||
gather_facts: no
|
|
||||||
tasks:
|
|
||||||
- name: Ping all hosts
|
|
||||||
ansible.builtin.ping:
|
|
||||||
|
|
||||||
- name: Afficher le hostname
|
|
||||||
ansible.builtin.command: hostname
|
|
||||||
register: hostname_output
|
|
||||||
|
|
||||||
- name: Montrer le résultat
|
|
||||||
ansible.builtin.debug:
|
|
||||||
msg: "Machine: {{ hostname_output.stdout }}"
|
|
||||||
-18
@@ -1,18 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Mise à jour des paquets
|
|
||||||
hosts: all
|
|
||||||
become: yes
|
|
||||||
tasks:
|
|
||||||
- name: Apt update
|
|
||||||
ansible.builtin.apt:
|
|
||||||
update_cache: yes
|
|
||||||
cache_valid_time: 3600
|
|
||||||
|
|
||||||
- name: Apt upgrade (safe)
|
|
||||||
ansible.builtin.apt:
|
|
||||||
upgrade: safe
|
|
||||||
register: upgrade_result
|
|
||||||
|
|
||||||
- name: Afficher le résultat
|
|
||||||
ansible.builtin.debug:
|
|
||||||
msg: "{{ upgrade_result.stdout_lines | default(['Aucune mise à jour nécessaire']) }}"
|
|
||||||
Reference in New Issue
Block a user