Browse Source

Initial commit of ansible-project

master
jacqueskingram 4 months ago
parent
commit
5f85fb0448
  1. 5
      add_keys.yaml
  2. 2
      hosts
  3. 0
      update-playbook/README.md
  4. 12
      update_upgrade.yaml

5
add_keys.yaml

@ -0,0 +1,5 @@
- name: Add SSH public key to authorized_keys
authorized_key:
user: jacques # User on the remote VM
key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}" # Path to your local public key
state: present

2
hosts

@ -0,0 +1,2 @@
[servers]
xochi.jacquesingram.online ansible_user=jacques

0
README.md → update-playbook/README.md

12
update_upgrade.yaml

@ -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
Loading…
Cancel
Save