diff --git a/node-exporter/node-exporter/config.yml b/node-exporter/node-exporter/config.yml new file mode 100644 index 0000000..c3e39f6 --- /dev/null +++ b/node-exporter/node-exporter/config.yml @@ -0,0 +1,3 @@ +# echo 1234 | htpasswd -inBC 10 "" | tr -d ':\n' +basic_auth_users: + admin: $2y$10$DflJBSLBlS2z3d9rk6pdk.EadVxBVlXc084wPgCqoaW2T1KblOjyi diff --git a/node-exporter/tasks/main.yml b/node-exporter/tasks/main.yml index 922cfde..5113da4 100644 --- a/node-exporter/tasks/main.yml +++ b/node-exporter/tasks/main.yml @@ -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 @@ -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'