Skip to content

Instantly share code, notes, and snippets.

View souzaxx's full-sized avatar
:shipit:
📟

Lucas de Souza souzaxx

:shipit:
📟
View GitHub Profile
@yanndegat
yanndegat / ec2ansibleinv.sh
Created April 28, 2017 11:26
ec2 instances to ansible inventory using jq
#!/bin/bash
STACK=$1
aws ec2 describe-instances | jq -r \
'[
.Reservations[].Instances[]
| . as $node
| {
ip: ($node.NetworkInterfaces[0].PrivateIpAddress),
name: ($node.Tags[] | select(.Key == "Name").Value),