Skip to content

Commit

Permalink
Add latest configuration option in Ansible agent role
Browse files Browse the repository at this point in the history
  • Loading branch information
pyrech committed May 7, 2021
1 parent 7dc6ac8 commit dd27cc7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ You may also configure:
* `redirectionio_agent_cache` (default: `true`): use in-memory cache to speed-up agent matching
* `redirectionio_agent_log` (default: `{}`): log configuration directives - see the [configuration template](./templates/agent.yml.j2) for more details.
* `redirectionio_agent_proxies` (default: `{}`) - see the [configuration reference](https://redirection.io/documentation/developer-documentation/agent-configuration-reference#proxies) for more details.
* `redirectionio_agent_project_keys` (default: `[]`) - see the [configuration reference](https://redirection.io/documentation/developer-documentation/agent-configuration-reference#project-keys) for more details.
* `redirectionio_agent_instance_logging` (default: `-`) - see the [configuration reference](https://redirection.io/documentation/developer-documentation/agent-configuration-reference#logging) for more details.
* `redirectionio_agent_instance_test_mode` (default: `-`) - see the [configuration reference](https://redirection.io/documentation/developer-documentation/agent-configuration-reference#test-mode) for more details.
* `redirectionio_agent_metrics_server` (default: `[]`) - see the [configuration reference](https://redirection.io/documentation/developer-documentation/agent-configuration-reference#metrics-server) for more details.

## Example playbook

Expand Down
24 changes: 21 additions & 3 deletions templates/agent.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ datadir: {{ redirectionio_agent_datadir }}

# Number of items to store in memory.
# This makes the agent much faster, but will consume more memory on very large rulesets if this setting is high
# With the default value, a very large ruleset shoud consume about 150-200 MB of memory
# With the default value, a very large ruleset should consume about 150-200 MB of memory
# Set to 0 to disable the cache and minimize memory usage
# Default value: 10000
cache: {{ redirectionio_agent_cache | lower }}
Expand All @@ -43,11 +43,29 @@ cache: {{ redirectionio_agent_cache | lower }}
# level: info
# tag: redirectionio-agent # optional
log:
{{ redirectionio_agent_log | to_nice_yaml }}
{{ redirectionio_agent_log | to_nice_yaml | indent(2) }}

# redirection.io API endpoint
host: {{ redirectionio_agent_host }}

{% if redirectionio_agent_proxies is defined %}
{{ redirectionio_agent_proxies | to_nice_yaml }}
proxies:
{{ redirectionio_agent_proxies | to_nice_yaml | indent(2) }}
{% endif %}

{% if redirectionio_agent_project_keys is defined %}
project_keys:
{{ redirectionio_agent_project_keys | to_nice_yaml | indent(2) }}
{% endif %}

{% if redirectionio_agent_instance_logging is defined %}
logging: {{ redirectionio_agent_instance_logging | lower }}
{% endif %}

{% if redirectionio_agent_instance_test_mode is defined %}
test_mode: {{ redirectionio_agent_instance_test_mode | lower }}
{% endif %}

{% if redirectionio_agent_metrics_server is defined %}
metrics_server: {{ redirectionio_agent_metrics_server }}
{% endif %}

0 comments on commit dd27cc7

Please sign in to comment.