Skip to content

Instantly share code, notes, and snippets.

View jhoelzel's full-sized avatar
available

Johannes Hölzel jhoelzel

available
  • Freelance Sr. Engineer with Kubernetes / DevOps / Golang Focus
  • Berlin
View GitHub Profile
@jhoelzel
jhoelzel / gist:1c015e667c162fc8f3f3712b1c6417c5
Created September 28, 2021 15:49
iptables / ip6tables allow only cloudflare IPs to acces our server
# https://www.cloudflare.com/ips
# https://support.cloudflare.com/hc/en-us/articles/200169166-How-do-I-whitelist-CloudFlare-s-IP-addresses-in-iptables-
for i in `curl https://www.cloudflare.com/ips-v4`; do iptables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done
for i in `curl https://www.cloudflare.com/ips-v6`; do ip6tables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done
@jhoelzel
jhoelzel / Ansible Alternative Directory Layout Structure
Last active February 9, 2022 23:09
Ansible Create Alternative Directory Layout Structure
# https://docs.ansible.com/ansible/latest/user_guide/playbooks_best_practices.html#id12
inventories/
production/
hosts # inventory file for production servers
group_vars/
group1.yml # here we assign variables to particular groups
group2.yml
host_vars/
hostname1.yml # here we assign variables to particular systems
hostname2.yml