Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ansible
Manage
Activity
Members
Labels
Plan
Issues
3
Issue boards
Milestones
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nounous
Ansible
Commits
67ffa3c8
Verified
Commit
67ffa3c8
authored
4 years ago
by
me5na7qbjqbrp
Browse files
Options
Downloads
Patches
Plain Diff
[prometheus] use dig lookup for adm ip
parent
ec3da3b8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
plays/monitoring.yml
+0
-11
0 additions, 11 deletions
plays/monitoring.yml
roles/prometheus-node-exporter/templates/default/prometheus-node-exporter.j2
+1
-1
1 addition, 1 deletion
...de-exporter/templates/default/prometheus-node-exporter.j2
with
1 addition
and
12 deletions
plays/monitoring.yml
+
0
−
11
View file @
67ffa3c8
#!/usr/bin/env ansible-playbook
---
# Set variable adm_iface for all servers
-
hosts
:
server
tasks
:
-
name
:
Register adm interface in adm_iface variable
shell
:
set -o pipefail && grep adm /sys/class/net/*/ifalias | sed "s|/sys/class/net/||" | sed "s|/ifalias:.*||"
register
:
adm_iface
check_mode
:
false
changed_when
:
true
args
:
executable
:
/bin/bash
# Deploy Prometheus and Grafana on monitoring server
-
hosts
:
fyre.adm.crans.org
vars
:
...
...
This diff is collapsed.
Click to expand it.
roles/prometheus-node-exporter/templates/default/prometheus-node-exporter.j2
+
1
−
1
View file @
67ffa3c8
...
...
@@ -4,7 +4,7 @@
# Due to shell scaping, to pass backslashes for regexes, you need to double
# them (\\d for \d). If running under systemd, you need to double them again
# (\\\\d to mean \d), and escape newlines too.
ARGS="--web.listen-address={{
hostvars[inventory_hostname]['ansible_' + adm_iface.stdout].ipv4.address
}}:9100"
ARGS="--web.listen-address={{
lookup('dig', ansible_host)
}}:9100"
# Prometheus-node-exporter supports the following options:
#
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment