Skip to content

Commit 478a096

Browse files
Merge remote-tracking branch 'origin/dev'
2 parents d29059e + d803324 commit 478a096

18 files changed

Lines changed: 1247 additions & 46 deletions

.gitignore

Lines changed: 142 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
# ETC
2-
.terraform.lock.hcl
3-
dashboard.yml
4-
grafana-config.ini
5-
hosts
6-
node-exporter.json
7-
playbooks/*
8-
prometheus.yml
9-
tfplan
2+
**/dashboard.yml
3+
**/grafana-config.ini
4+
**/hosts
5+
**/node-exporter.json
6+
**/prometheus.yml
7+
data/*
8+
facts/*
109

1110
# General
1211
.DS_Store
@@ -47,10 +46,7 @@ Temporary Items
4746
crash.log
4847
crash.*.log
4948

50-
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
51-
# password, private keys, and other secrets. These should not be part of version
52-
# control as they are data points which are potentially sensitive and subject
53-
# to change depending on the environment.
49+
# Exclude all .tfvars files
5450
*.tfvars
5551
*.tfvars.json
5652

@@ -61,11 +57,9 @@ override.tf.json
6157
*_override.tf
6258
*_override.tf.json
6359

64-
# Include override files you do wish to add to version control using negated pattern
65-
# !example_override.tf
66-
67-
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
68-
# example: *tfplan*
60+
# Ignore terraform state
61+
.terraform.lock.hcl
62+
tfplan
6963

7064
# Ignore CLI configuration files
7165
.terraformrc
@@ -234,6 +228,137 @@ cython_debug/
234228
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
235229
#.idea/
236230

231+
# Logs
232+
logs
233+
*.log
234+
npm-debug.log*
235+
yarn-debug.log*
236+
yarn-error.log*
237+
lerna-debug.log*
238+
.pnpm-debug.log*
239+
240+
# Diagnostic reports (https://nodejs.org/api/report.html)
241+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
242+
243+
# Runtime data
244+
pids
245+
*.pid
246+
*.seed
247+
*.pid.lock
248+
249+
# Directory for instrumented libs generated by jscoverage/JSCover
250+
lib-cov
251+
252+
# Coverage directory used by tools like istanbul
253+
coverage
254+
*.lcov
255+
256+
# nyc test coverage
257+
.nyc_output
258+
259+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
260+
.grunt
261+
262+
# Bower dependency directory (https://bower.io/)
263+
bower_components
264+
265+
# node-waf configuration
266+
.lock-wscript
267+
268+
# Compiled binary addons (https://nodejs.org/api/addons.html)
269+
build/Release
270+
271+
# Dependency directories
272+
node_modules/
273+
jspm_packages/
274+
275+
# Snowpack dependency directory (https://snowpack.dev/)
276+
web_modules/
277+
278+
# TypeScript cache
279+
*.tsbuildinfo
280+
281+
# Optional npm cache directory
282+
.npm
283+
284+
# Optional eslint cache
285+
.eslintcache
286+
287+
# Optional stylelint cache
288+
.stylelintcache
289+
290+
# Microbundle cache
291+
.rpt2_cache/
292+
.rts2_cache_cjs/
293+
.rts2_cache_es/
294+
.rts2_cache_umd/
295+
296+
# Optional REPL history
297+
.node_repl_history
298+
299+
# Output of 'npm pack'
300+
*.tgz
301+
302+
# Yarn Integrity file
303+
.yarn-integrity
304+
305+
# dotenv environment variable files
306+
.env
307+
.env.development.local
308+
.env.test.local
309+
.env.production.local
310+
.env.local
311+
312+
# parcel-bundler cache (https://parceljs.org/)
313+
.cache
314+
.parcel-cache
315+
316+
# Next.js build output
317+
.next
318+
out
319+
320+
# Nuxt.js build / generate output
321+
.nuxt
322+
dist
323+
324+
# Gatsby files
325+
.cache/
326+
# Comment in the public line in if your project uses Gatsby and not Next.js
327+
# https://nextjs.org/blog/next-9-1#public-directory-support
328+
# public
329+
330+
# vuepress build output
331+
.vuepress/dist
332+
333+
# vuepress v2.x temp and cache directory
334+
.temp
335+
.cache
336+
337+
# Docusaurus cache and generated files
338+
.docusaurus
339+
340+
# Serverless directories
341+
.serverless/
342+
343+
# FuseBox cache
344+
.fusebox/
345+
346+
# DynamoDB Local files
347+
.dynamodb/
348+
349+
# TernJS port file
350+
.tern-port
351+
352+
# Stores VSCode versions used for testing VSCode extensions
353+
.vscode-test
354+
355+
# yarn v2
356+
.yarn/cache
357+
.yarn/unplugged
358+
.yarn/build-state.yml
359+
.yarn/install-state.gz
360+
.pnp.*
361+
237362
# INCLUDE
238363
!**/*.example
239364
!**/.gitkeep

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
terraform 1.9.8
21
python 3.11.10
2+
tenv 3.2.9

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"ansible.python.interpreterPath": "${workspaceFolder}/.venv/bin/python"
3+
}

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,18 @@ It is possible to automatically apply some fixes, but these should be reviewed b
3636

3737
## TODO
3838

39-
* Add [restart: unless-stopped](https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs/resources/container#restart) to all containers
40-
* Use [remote hosts](https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs#remote-hosts) specifically for exporters
39+
* Use docker-compose specifically for exporters
4140
* node-exporter
4241
* nodejs
4342
* mongodb
4443
* elasticsearch
4544
* redis
45+
* Reinstate ansible terraform provider
46+
* Takes care of inventory and remote state (e.g., `terraform destroy`)
47+
* Reorganize repo into top-level directories
48+
* `ansible`
49+
* `docker`
50+
* `terraform`
4651

4752
## Further Reading
4853

ansible.cfg

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[defaults]
2+
log_path = /var/log/ansible.log
3+
inventory = ./hosts
4+
roles_path = ./roles
5+
host_key_checking = False
6+
retry_files_enabled = False
7+
remote_tmp = /tmp/${USER}/ansible
8+
gathering = smart
9+
fact_caching = jsonfile
10+
fact_caching_connection = ./facts
11+
fact_caching_prefix = ansible_facts_

app/app.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import express from 'express';
2+
import { collectDefaultMetrics, register } from 'prom-client';
3+
4+
collectDefaultMetrics();
5+
6+
const app = express();
7+
8+
app.get('/metrics', async (_req, res) => {
9+
try {
10+
res.set('Content-Type', register.contentType);
11+
res.end(await register.metrics());
12+
} catch (err) {
13+
res.status(500).end(err);
14+
}
15+
});
16+
17+
app.listen(4001, '0.0.0.0');

0 commit comments

Comments
 (0)