aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/defaults/main.yml
blob: 5589273c71228929c88f2ea930d6325070919635 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
---
# This should be your prometheus host as it is defined in your ansible
# inventory. This is where all the target files specified in the exporters
# `path` should exist. The host is used for the delegated tasks in this role.
# ---
# prometheus_target_host:

# This is the strategy that is used for adding hosts.
# See readme for more info on the individual strategies.
prometheus_target_strategy: lineinfile


################################################################################
# Handler configuration
################################################################################

# On the change of any target file the command and the shell handler will be
# triggered. You can use this to reload your prometheus instance, commit target
# changes somewhere, ...

# This variable enables the command handler. Make sure to also provide the
# necessary configuration in prometheus_target_handler_command
prometheus_target_handler_command_enabled: false

# By default the target command handler will be run with root privileges on the
# prometheus host. This is useful if you want to send a signal to the prometheus
# host to trigger a reload. In other instances, for example if you reload the
# instance with a curl command, or ssh with the prometheus user, this may not be
# necessary.
prometheus_target_handler_command_become: true
# prometheus_target_handler_command_become_method:
# prometheus_target_handler_command_become_user:

# This is the configuration for the command module. For documentation see:
# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/command_module.html
# ---
# prometheus_target_handler_command:
#   argv:
#   chdir:
#   cmd:
#   creates:
#   free_form:
#   removes:
#   stdin:
#   stdin_add_newline:

# This is the same as the prometheus_target_handler_command settings but uses
# the ansible shell module. You might want to consider using this if you require
# things such as environment variables in the handler.
prometheus_target_handler_shell_enabled: false

# This will configure if the shell handler is run with root privileges or not.
# See documentation for prometheus_target_handler_command_become above.
prometheus_target_handler_shell_become: true
# prometheus_target_handler_shell_become_method:
# prometheus_target_handler_shell_become_user:

# This is the configuration for the shell module. For documentation see:
# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/shell_module.html
# ---
# prometheus_target_handler_shell:
#   chdir:
#   cmd:
#   creates:
#   executable:
#   free_form:
#   removes:
#   stdin:
#   stdin_add_newline:


################################################################################
# lineinfile strategy configuration
################################################################################

# You can use these 2 settings to prefix / suffix all of your exporters.
# With the yaml target configurations you might have target files like this:
# ---
# - targets:
#   - target_1
#   - target_2
# ...
# This configuration is mostly used for globally indenting all of your targets
# in their target configuration and thus keeping this configuration away from
# the exporter host variable.
prometheus_target_strategy_lineinfile_prefix: '    - '
prometheus_target_strategy_lineinfile_suffix: ''


################################################################################
# Exporter configuration
################################################################################

# This will configure the default settings for specified exporters.
# The key in this dict should map to the possible id in the specified exporter
# in prometheus_target_exporter or prometheus_target_default_exporters.
# The settings specified in prometheus_target_exporter will supersede the ones
# here. It is recommended to specify the defaults for all exporters in use since
# usually the path / host parameters can be auto generated from variables and
# static information such as the port the exporter usually runs on.
# Ideally the only thing you should specify on the role level is the id, i.e.
# the exporter you want to enable, to keep a clean configuration.
prometheus_target_exporter_defaults: {}
  # node_exporter:
  #   path: /opt/prometheus/targets.yml
  #   host: '{{ inventory_hostname }}:9100'
  # blackbox_exporter:
  #   path: /opt/prometheus/blackbox.yml
  #   host: 'https://{{ hostvars[inventory_hostname].ansible_host }}'

# This is where you specify the exporters that should be deployed to prometheus.
# You should configure this on a per play basis. If you wish to configure
# exporters that are added on every play i.e. default exporters see the
# prometheus_target_default_exporters variable below.
prometheus_target_exporter: []
  # - id: node_exporter
  #   # overwrites prometheus_target_exporter_defaults.node_exporter.path
  #   path: /path/to/targets/file/on/prometheus/host
  #   # overwrites: prometheus_target_exporter_defaults.node_exporter.host
  #   host: '{{ inventory_hostname }}:9100'

# This is a list of exporters that will be appended to the
# prometheus_target_exporter variable. duplicate exporters in
# prometheus_target_exporter and prometheus_target_default_exporters will be
# ignored.
prometheus_target_default_exporters: [] # TODO: Implement
  # - { id: node_exporter }
  # - { id: blackbox_exporter, path: /path/to/target }

# You can enable this variable to not add exporters defined in
# prometheus_target_default_exporters
prometheus_target_skip_default_exporters: false # TODO: Implement