Add ansible

This commit is contained in:
Gabriel Simmer 2022-11-06 21:59:08 +00:00
parent ea9fb0d556
commit 4c73f47a73
Signed by: arch
GPG key ID: C81B106D46C5B875
3 changed files with 36 additions and 0 deletions

15
ansible/inventory Normal file
View file

@ -0,0 +1,15 @@
[hetzk3s]
100.65.241.12 ansible_user=root
[homelab]
100.120.232.77 # K3S control Pi
100.103.185.70 # Secondary Pi in cluster
[oracle]
100.108.178.121 ansible_user=ubuntu # Minecraft Server
100.102.227.88 ansible_user=ubuntu # Uptime Kuma
[debian:children]
hetzk3s
homelab
oracle

13
ansible/ssh-keys.yaml Normal file
View file

@ -0,0 +1,13 @@
---
- hosts: all
tasks:
- name: get current user
command: whoami
register: remote_user
- debug: msg="{{remote_user.stdout}}"
- name: Set authorized key took from file
authorized_key:
user: "{{ remote_user.stdout }}"
state: present
key: https://github.com/gmemstr.keys

8
ansible/updates.yaml Normal file
View file

@ -0,0 +1,8 @@
- name: Apt updates
hosts: debian
become: true
tasks:
- name: Apt update
ansible.builtin.apt:
update_cache: yes
upgrade: yes