ansible-kubernetes-hetzner/tasks/hetzner_nat/configuration_nat.yml

27 lines
740 B
YAML

######################################
# 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