From 76fe54cd3e06374c6bde14c964a60ea29b42f240 Mon Sep 17 00:00:00 2001 From: Bertrand Lanson Date: Fri, 2 Jun 2023 15:25:56 +0200 Subject: [PATCH] few changes --- README.md | 4 ++-- defaults/main.yml | 12 +++++++++++- tasks/main.yml | 2 +- templates/docker-compose.yml.j2 | 24 +++++++++++++++--------- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 4592187..7c8a87c 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Available variables are listed below, along with default values. A sample file f Dependencies ------------ -This role has a task that installs its own dependencies located in `task/prerequisites.yml`, so that you don't need to manage them. This role requires both `ednxzu.manage_repositories` and `ednxzu.manage_apt_packages` to install consul. +None. Example Playbook ---------------- @@ -25,7 +25,7 @@ Example Playbook # calling the role inside a playbook with either the default or group_vars/host_vars - hosts: servers roles: - - ednxzu.hashicorp_consul + - ednxzu.deploy_adguard ``` License diff --git a/defaults/main.yml b/defaults/main.yml index 4ccb4df..8622d1f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -9,9 +9,19 @@ deploy_adguard_enable_dot: false deploy_adguard_enable_doq: false deploy_adguard_enable_dnscrypt: false deploy_adguard_start_service: false -deploy_adguard_node_exporter: false deploy_adguard_virtual_ip: enable: false interface: eth0 vip_addr: "192.168.1.53" +deploy_adguard_node_exporter: + enable: false + protocol: http + port: 80 + username: changeme + password: changeme + exporter_port: 9617 + interval: 10s + log_limit: 10000 +deploy_adguard_consul: + enable: false deploy_adguard_config: {} diff --git a/tasks/main.yml b/tasks/main.yml index 59b0e3c..d410a2c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -4,4 +4,4 @@ ansible.builtin.include_tasks: prerequisites.yml - name: "Import configure.yml" - ansible.builtin.include_tasks: configure.yml \ No newline at end of file + ansible.builtin.include_tasks: configure.yml diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index 8432a5d..0b255c0 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -54,16 +54,18 @@ services: node_exporter: image: ebrianne/adguard-exporter:latest + secrets: + - adguard_passw environment: - - adguard_protocol=http - - adguard_hostname=192.168.10.252 - - adguard_username=admin - - adguard_password=/run/secrets/my-adguard-pass - - adguard_port= #optional - - server_port=9617 - - interval=10s - - log_limit=10000 - - password_from_file=true + adguard_protocol: {{ deploy_adguard_node_exporter['protocol'] }} + adguard_hostname: adguard + adguard_username: {{ deploy_adguard_node_exporter['username'] }} + adguard_password: /run/secrets/adguard_passw + adguard_port: {{ deploy_adguard_node_exporter['port'] }} + server_port: {{ deploy_adguard_node_exporter['exporter_port'] }} + interval: {{ deploy_adguard_node_exporter['interval'] }} + log_limit: {{ deploy_adguard_node_exporter['log_limit'] }} + password_from_file: true ports: - "9617:9617" networks: @@ -85,3 +87,7 @@ volumes: o: bind device: {{ deploy_adguard_directory }}/data type: none + +secrets: + adguard_passw: + file: {{ deploy_adguard_directory }}/password