Add ansible
This commit is contained in:
parent
ea9fb0d556
commit
4c73f47a73
15
ansible/inventory
Normal file
15
ansible/inventory
Normal 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
13
ansible/ssh-keys.yaml
Normal 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
8
ansible/updates.yaml
Normal file
|
@ -0,0 +1,8 @@
|
|||
- name: Apt updates
|
||||
hosts: debian
|
||||
become: true
|
||||
tasks:
|
||||
- name: Apt update
|
||||
ansible.builtin.apt:
|
||||
update_cache: yes
|
||||
upgrade: yes
|
Loading…
Reference in a new issue