Skip to content

Commit

Permalink
feat: add basic auth to the node exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
arsalanses authored Jan 10, 2024
1 parent ba83c92 commit 32c11fb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions node-exporter/node-exporter/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# echo 1234 | htpasswd -inBC 10 "" | tr -d ':\n'
basic_auth_users:
admin: $2y$10$DflJBSLBlS2z3d9rk6pdk.EadVxBVlXc084wPgCqoaW2T1KblOjyi
16 changes: 16 additions & 0 deletions node-exporter/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
- name: Services directory
ansible.builtin.file:
path: /root/services/
state: directory
mode: '744'

- name: Copy node-exporter
ansible.builtin.copy:
src: node-exporter
dest: /root/services/
owner: root
group: root
mode: '744'

- name: Install node-exporter
community.docker.docker_container:
name: node-exporter
Expand All @@ -13,8 +27,10 @@
- "/proc:/host/proc:ro"
- "/sys:/host/sys:ro"
- "/:/rootfs:ro"
- "/root/services/node-exporter/config.yml:/etc/node_exporter/config.yml"
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
- '--web.config=/etc/node_exporter/config.yml'

0 comments on commit 32c11fb

Please sign in to comment.