From 854daa0d468997363dd6e10953824462de1d0cb6 Mon Sep 17 00:00:00 2001 From: Heath Seals Date: Fri, 23 Aug 2019 13:33:03 -0500 Subject: [PATCH] Add Docker file and generate wrapper --- CODEOWNERS | 8 ++++++++ Dockerfile | 6 ++++++ generate.py | 17 +++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 CODEOWNERS create mode 100644 Dockerfile create mode 100755 generate.py diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..7832d20 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,8 @@ +# This will cause InfraCore to be assigned review of any opened PRs against +# the branches containing this file. +# See https://help.github.com/en/articles/about-code-owners for info on how to +# take ownership of parts of the code base that should be reviewed by another +# team. + +* @puppetlabs/infracore + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..736157e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM python:3 +ADD generate.py / +RUN pip install --upgrade pip +#RUN pip install --upgrade --extra-index-url https://artifactory.delivery.puppetlabs.net/artifactory/api/pypi/pypi/simple infinitory +RUN pip install git+git://github.com/puppetlabs/infinitory.git@setup_fixup +CMD [ "python", "generate.py", "pe-master-infranext-prod-1.infc-aws.puppet.net" ] diff --git a/generate.py b/generate.py new file mode 100755 index 0000000..4a9853b --- /dev/null +++ b/generate.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 + +import sys +import subprocess + +if len(sys.argv) == 1: + puppetdb = 'localhost' +elif len(sys.argv) == 2: + puppetdb = sys.argv[1] +else: + sys.exit("Expected 1 or 0 arguments. Got {}.".format(len(sys.argv) - 1)) + +# Generate the report +subprocess.check_call( + ["infinitory", "--host", "{}".format(puppetdb), + "--output", "/srv/infinitory/output"], + timeout=120)