ansible proxy jump

Ansible can proxy through a jump host / bastion host to connect to systems, but there's something to watch out for that can cause a rather vague connection failure of failed to connect to host via ssh citing kex_exchange_identification Connection closed by remote host and Connection closed by UNKNOWN…

ansible arping

Building on previous work for subnet scanning [https://blog.chasefox.net/ansible-iterate-a-subnet/] with ansible, I've written a small playbook to identify IP conflicts within a remote network using ansible. The inventory for the playbook can be any host that has the arping command, which includes any linux machine, or edgemax…

AWK IPTables

Using ansible with iptables is a bit clunky, particularly with rule ordering and duplication. The ansible iptables module does not check for existing rules before plopping new ones in, and older systems (without -C) can be tricky to check for existence of rules. This post explores using ansible to update…

Ansible loop control

How has it taken me this long?! Sometimes I feel tremendously silly for overlooking the simplest of answers. I've used loop_control to change the default loop variable, but I've never noticed loop_control can also change the loop label. This is a game changer! Previously, I've mangled data objects…

Ansible Iterate a Subnet

Ansible logic constructs are very simple. There are no for loops, but there is with_sequence. If we can make a list, we can iterate the list. This shows how to make a simple list of host addresses given a subnet (in CIDR notation). --- - hosts: localhost gather_facts:…