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