Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions roles/snmp_exporter/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ snmp_exporter_config_file: ""

snmp_exporter_binary_install_dir: "/usr/local/bin"
snmp_exporter_config_dir: "/etc/snmp_exporter"
snmp_exporter_expand_environment_variables: false

# Local path to stash the archive and its extraction
snmp_exporter_local_cache_path: "/tmp/snmp_exporter-{{ ansible_facts['system'] | lower }}-{{ _snmp_exporter_go_ansible_arch }}/{{ snmp_exporter_version }}"
Expand Down
5 changes: 5 additions & 0 deletions roles/snmp_exporter/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,8 @@ argument_specs:
snmp_exporter_config_dir:
description: "Path to directory with snmp_exporter configuration"
default: "/etc/snmp_exporter"
snmp_exporter_expand_environment_variables:
description:
- "allows passing environment variables into some fields of the configuration file."
- "The username, password & priv_password fields in the auths section are supported."
default: false
3 changes: 3 additions & 0 deletions roles/snmp_exporter/templates/snmp_exporter.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ ExecStart={{ snmp_exporter_binary_install_dir }}/snmp_exporter \
{% endfor %}
{% else %}
--web.listen-address={{ snmp_exporter_web_listen_address }} \
{% endif %}
{% if snmp_exporter_expand_environment_variables %}
--config.expand-environment-variables \
{% endif %}
--log.level={{ snmp_exporter_log_level }} \
--config.file={{ snmp_exporter_config_dir }}/snmp.yml
Expand Down
Loading