revert deploy mongodb database
This commit is contained in:
2024-04-23 12:59:19 +02:00
parent 271d48c03d
commit 8bf90d120d
22 changed files with 786 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:
+26
View File
@@ -0,0 +1,26 @@
######################################
# Configuration NAT-Server #
######################################
---
- name: Copy Public ssh-key and paste to NAT-Server
copy:
src: /tmp/id_rsa.pub
dest: ~/.ssh/
- name: Copy Private ssh-key and paste to NAT-Server
copy:
src: /tmp/id_rsa
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 eth0
iface eth0 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 eth0 -j MASQUERADE
+10
View File
@@ -0,0 +1,10 @@
######################################
# Generate SSH-Key #
######################################
---
- name: Generate an OpenSSH keypair local
community.crypto.openssh_keypair:
path: /tmp/id_rsa
type: rsa