This commit is contained in:
2024-04-08 09:40:36 +02:00
commit f29f47ba64
82 changed files with 61981 additions and 0 deletions
@@ -0,0 +1,31 @@
######################################
# Configuration Client-Server #
######################################
---
- name: Edit Network interface file on Client Server
blockinfile:
path: /etc/network/interfaces
block: |
auto enp7s0
iface enp7s0 inet dhcp
post-up ip route add default via 10.0.0.1
- name: Add Hetzner Nameserver
blockinfile:
path: /etc/resolvconf/resolv.conf.d/head
block: |
nameserver 8.8.8.8
nameserver 8.8.4.4
- name: Enable Updates for resolvconf
raw: "resolvconf --enable-updates"
- name: Update resolvconf
raw: "resolvconf -u"
- name: Reboot Clients
reboot:
+21
View File
@@ -0,0 +1,21 @@
######################################
# Configuration NAT-Server #
######################################
---
- name: Copy Public ssh-key and paste to NAT-Server
copy:
src: /tmp/id_rsa.pub
dest: ~/.ssh/
- name: Change Permission of the Private ssh-key only to read for the User
raw: "chmod 0400 ~/.ssh/id_rsa"
- name: Edit Network interface file on NAT-Server
blockinfile:
path: /etc/network/interfaces
block: |
auto enp7s0
iface enp7s0 inet dhcp
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.0.0.0/16' -o enp7s0 -j MASQUERADE
+8
View File
@@ -0,0 +1,8 @@
######################################
# Generate SSH-Key #
######################################
---
- name: Generate an OpenSSH keypair local
community.crypto.openssh_keypair:
path: /tmp/id_rsa
type: rsa