(DIO-834) Refactor to use pdb queries, output to GCS Bucket

This commit is contained in:
suckatrash 2020-08-25 05:36:41 -07:00
parent 854daa0d46
commit fd1ad61fce
No known key found for this signature in database
GPG key ID: 3857A763831B0756
9 changed files with 107 additions and 60 deletions

31
README.md Normal file
View file

@ -0,0 +1,31 @@
SRE Inventory Report
====================
Generate a report on SRE inventory, including hosts, roles, and
services.
## Running in Docker
```
docker run -e GOOGLE_APPLICATION_CREDENTIALS=$GOOGLE_APPLICATION_CREDENTIALS -e BUCKET=<GCP_BUCKET_NAME> -e TOKEN=<PDB_ACCESS_TOKEN> -v /tmp:/output:rw --add-host <pdb-host>:<pdb-hostip> infinitory-app
```
Using `GOOGLE_APPLICATION_CREDENTIALS` may require an extra volume mount in some cases:
```
-v /path/to/creds.json:/creds.json
```
...where your ENV variable points to that file:
```
export GOOGLE_APPLICATION_CREDENTIALS=/creds.json
```
## Developing
Use python setup.py develop to install dependencies
Run in Dev:
bin/infinitory -h pdb.ops.puppetlabs.net -t <pdb-access-token> -o /tmp/output -b <gcs-bucket-name>