-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This does share some implicit configuration from the target_all but as we always deploy those together this should be fine. For online instances which are directly connected to the internet we didn't secure all metrics. This is now done for: node (builtin) mysql (builtin) fpm (builtin) nginx (Custom NGINX config)
- Loading branch information
Showing
7 changed files
with
71 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
provision-contest/ansible/roles/prometheus_target_all/files/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.key | ||
*.crt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
provision-contest/ansible/roles/prometheus_target_all/templates/web.yml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
basic_auth_users: | ||
prometheus: {{ htpassd_shell.stdout }} | ||
tls_server_config: | ||
cert_file: /etc/prometheus/node_exporter.crt | ||
key_file: /etc/prometheus/node_exporter.key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
provision-contest/ansible/roles/prometheus_target_web/templates/nginx-status.conf.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
server { | ||
listen 127.0.0.1:8787; | ||
server_name _default_; | ||
|
||
location = /basic_status { | ||
stub_status; | ||
} | ||
} | ||
|
||
server { | ||
listen 0.0.0.0:9113 ssl; | ||
ssl_certificate /etc/prometheus/node_exporter.crt; | ||
ssl_certificate_key /etc/prometheus/node_exporter.key; | ||
ssl_protocols TLSv1.3; | ||
|
||
auth_basic "Prometheus scraping"; | ||
auth_basic_user_file /etc/prometheus/.htpasswd; | ||
location / { | ||
proxy_pass http://127.0.0.1:19113; | ||
} | ||
} | ||
|
||
server { | ||
listen 0.0.0.0:9253 ssl; | ||
ssl_certificate /etc/prometheus/node_exporter.crt; | ||
ssl_certificate_key /etc/prometheus/node_exporter.key; | ||
ssl_protocols TLSv1.3; | ||
|
||
auth_basic "Prometheus scraping"; | ||
auth_basic_user_file /etc/prometheus/.htpasswd; | ||
location / { | ||
proxy_pass http://127.0.0.1:19253; | ||
} | ||
} |