Initial commit of ansible-project
This commit is contained in:
12
update_upgrade.yaml
Normal file
12
update_upgrade.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
- hosts: servers # Targets the "servers" group defined in your inventory
|
||||
become: true # Important: This enables privilege escalation (sudo)
|
||||
become_user: root # Explicitly become root (optional, but good practice)
|
||||
tasks:
|
||||
- name: Update apt cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
|
||||
- name: Upgrade packages
|
||||
apt:
|
||||
upgrade: yes
|
||||
Reference in New Issue
Block a user