Public | Automated Build

Last pushed: a year ago
Short Description
Generate a dynamic inventory from puppetdb using
Full Description

#!/usr/bin/env bash
# returns a JSON formatted inventory from puppetdb
# this script is not meant to be called directly, but only by ansible
# as part of a standalone or playbook run
# usage: ansible -i -m ping all
#        ansible-playbook -i kickPuppet.yaml

# figure out what network name docker-compose is using for puppetserver
PUPPETSERVER_NETWORK=$( docker ps -a |  awk '/puppet-server/{print $1}' | xargs docker inspect |  grep NetworkMode | cut -d: -f2 | sed 's/\"\(.*\)\",/\1/' )
docker run --net ${PUPPETSERVER_NETWORK} adamancini/ansible-puppetdb-dynamic-inventory
Docker Pull Command