Hi All,
I have written some BASH ;( scripts that collects some information and shows them
"very" human friendly and colourful format. Via Aws Cli, json processing etc.
An obfuscated example as below for displaying the idea // result.
#========================================================
#=== VPCCOUNT X
#=== VPCID vpc-xxxxxxxx
#=== HOWMANYSECGRPs Y
#=== myVPCCIDR ZZ.X.X.X/XX
#=== myVPCTAG ZZ.X.X.X/XX
#========================================================
#--------------------------------------------------------
#-- GRP 1 vpc-xxxxxxxx sg-aaaaaaaa BBBBBBBBBBBBBB-sgp
#--------------------------------------------------------
RULES 1: 1: 12345 -tcp- 12345 111.111.111.111/32
RULES 1: 1: 12345 -tcp- 12345 222.222.222.222/32
RULES 1: 1: 12345 -tcp- 12345 333.333.333.333/32
RULES 1: 1: 12345 -tcp- 12345 444.444.444.444/32
RULES 1: 1: 12345 -tcp- 12345 555.555.555.555/32
#--------------------------------------------------------
#-- GRP 2 vpc-yyyyyyyy sg-cccccccc default
#--------------------------------------------------------
RULES 1: 1: -nul- sg-ssssssssNow, I would like to convert those as Ansible User Modules.
The first hurdle I am facing that making Ansible print formatted & coloured
output (like mine above) on STDOUT (a.k.a. the terminal I an running it,
Linux, Centos, BASH). I love Python, btw.
Could you kindly give me some pointers and ideas for me to get started?
Best Regards: JohnP