<linkrel="prev"title="prometheus.prometheus.node_exporter role – Prometheus Node Exporter"href="node_exporter_role.html"/><!-- extra head elements for Ansible beyond RTD Sphinx Theme -->
</head>
<bodyclass="wy-body-for-nav"><!-- extra body elements for Ansible beyond RTD Sphinx Theme -->
<liclass="toctree-l1"><aclass="reference internal"href="alertmanager_role.html">prometheus.prometheus.alertmanager role – Prometheus Alertmanager service</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="blackbox_exporter_role.html">prometheus.prometheus.blackbox_exporter role – Deploy and manage Prometheus blackbox exporter</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="mysqld_exporter_role.html">prometheus.prometheus.mysqld_exporter role – Prometheus MySQLd Exporter</a></li>
<liclass="toctree-l1"><aclass="reference internal"href="node_exporter_role.html">prometheus.prometheus.node_exporter role – Prometheus Node Exporter</a></li>
<liclass="toctree-l1 current"><aclass="current reference internal"href="#">prometheus.prometheus.prometheus role – Installs and configures prometheus</a><ul>
<liclass="toctree-l2"><aclass="reference internal"href="#entry-point-main-installs-and-configures-prometheus">Entry point <codeclass="docutils literal notranslate"><spanclass="pre">main</span></code>– Installs and configures prometheus</a><ul>
<h1>prometheus.prometheus.prometheus role – Installs and configures prometheus<aclass="headerlink"href="#prometheus-prometheus-prometheus-role-installs-and-configures-prometheus"title="Link to this heading"></a></h1>
<p>This role is part of the <aclass="reference external"href="https://galaxy.ansible.com/ui/repo/published/prometheus/prometheus/">prometheus.prometheus collection</a> (version 0.7.0).</p>
<p>It is not included in <codeclass="docutils literal notranslate"><spanclass="pre">ansible-core</span></code>.
To check whether it is installed, run <codeclass="code docutils literal notranslate"><spanclass="pre">ansible-galaxy</span><spanclass="pre">collection</span><spanclass="pre">list</span></code>.</p>
<p>To install it use: <codeclass="code docutils literal notranslate"><spanclass="pre">ansible-galaxy</span><spanclass="pre">collection</span><spanclass="pre">install</span><spanclass="pre">prometheus.prometheus</span></code>.</p>
<p>To use it in a playbook, specify: <codeclass="code docutils literal notranslate"><spanclass="pre">prometheus.prometheus.prometheus</span></code>.</p>
</div>
<navclass="contents local"id="contents">
<ulclass="simple">
<li><p><aclass="reference internal"href="#entry-point-main-installs-and-configures-prometheus"id="id1">Entry point <codeclass="docutils literal notranslate"><spanclass="pre">main</span></code>– Installs and configures prometheus</a></p>
<h2><aclass="toc-backref"href="#id1"role="doc-backlink">Entry point <codeclass="docutils literal notranslate"><spanclass="pre">main</span></code>– Installs and configures prometheus</a><aclass="headerlink"href="#entry-point-main-installs-and-configures-prometheus"title="Link to this heading"></a></h2>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_agent_mode"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">boolean</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>The Agent mode optimizes Prometheus for the remote write use case. It disables querying, alerting, and local storage, and replaces it with a customized TSDB WAL. <aclass="reference external"href="https://prometheus.io/docs/prometheus/latest/feature_flags/#prometheus-agent">Everything</a> else stays the same.</p>
<p>This feature is available starting from Prometheus v2.32.0.</p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_alert_relabel_configs"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Alert relabeling rules. This should be specified as list in yaml format.</p>
<p>It is compatible with the official <aclass="reference external"href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs">alert_relabel_configs</a></p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_alert_rules"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=dictionary</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Full list of alerting rules which will be copied to <codeclass="docutils literal notranslate"><spanclass="pre">{{</span><spanclass="pre">prometheus_config_dir</span><spanclass="pre">}}/rules/ansible_managed.rules</span></code>.</p>
<p>Alerting rules can be also provided by other files located in <codeclass="docutils literal notranslate"><spanclass="pre">{{</span><spanclass="pre">prometheus_config_dir</span><spanclass="pre">}}/rules/</span></code> which have <codeclass="docutils literal notranslate"><spanclass="pre">*.rules</span></code> extension</p>
<p>Please see default values in role defaults/main.yml</p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_alert_rules_files"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>List of folders where ansible will look for files containing alerting rules which will be copied to <codeclass="docutils literal notranslate"><spanclass="pre">{{</span><spanclass="pre">prometheus_config_dir</span><spanclass="pre">}}/rules/</span></code>.</p>
<p>Files must have <codeclass="docutils literal notranslate"><spanclass="pre">*.rules</span></code> extension</p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_alertmanager_config"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Configuration responsible for pointing where alertmanagers are. This should be specified as list in yaml format.</p>
<p>It is compatible with the official <aclass="reference external"href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alertmanager_config">alertmanager_config</a></p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_binary_local_dir"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Allows to use local packages instead of ones distributed on github.</p>
<p>As parameter it takes a directory where <em>prometheus</em> AND <em>promtool</em> binaries are stored on host on which ansible is ran.</p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_binary_url"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>URL of the prometheus binaries .tar.gz file</p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_checksums_url"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>URL of the prometheus checksums file</p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_config_dir"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Path to directory with prometheus configuration</p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_config_file"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Variable used to provide custom prometheus configuration file in form of ansible template</p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_config_flags_extra"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">dictionary</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Additional configuration flags passed to prometheus binary at startup</p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_db_dir"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Path to directory with prometheus database</p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_external_labels"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">dictionary</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Provide map of additional labels which will be added to any time series or alerts when communicating with external systems</p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_global"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">dictionary</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Prometheus global config. It is compatible with the <aclass="reference external"href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#configuration-file">official configuration</a></p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_metrics_path"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">string</span></p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_read_only_dirs"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Additional paths that Prometheus is allowed to read (useful for SSL certs outside of the config directory)</p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_remote_read"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Remote read. It is compatible with the <aclass="reference external"href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_read">official configuration</a></p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_remote_write"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Remote write. Compatible with the <aclass="reference external"href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write">official configuration</a></p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_scrape_configs"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=dictionary</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Prometheus scrape jobs provided in same format as in the <aclass="reference external"href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config">official docs</a></p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_skip_install"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">boolean</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Prometheus installation tasks gets skipped when set to true.</p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_static_targets_files"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">list</span> / <spanclass="ansible-option-elements">elements=string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>List of folders where ansible will look for files containing custom static target configuration files which will be copied to <codeclass="docutils literal notranslate"><spanclass="pre">{{</span><spanclass="pre">prometheus_config_dir</span><spanclass="pre">}}/file_sd/</span></code>.</p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_stop_timeout"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>How long to wait for Prometheus to shutdown. This is passed as a systemd TimeoutStopSec time spec.</p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_storage_retention"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">string</span></p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_storage_retention_size"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Data retention period by size</p>
<p>Maximum number of bytes that can be stored for blocks.</p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_targets"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">dictionary</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Targets which will be scraped.</p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_version"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Prometheus package version. Also accepts <codeclass="docutils literal notranslate"><spanclass="pre">latest</span></code> as parameter.</p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_web_config"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">dictionary</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>A Prometheus <aclass="reference external"href="https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md">web config yaml</a> for configuring TLS and auth.</p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_web_external_url"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>External address on which prometheus is available. Useful when behind reverse proxy. Ex. `http://example.org/prometheus`</p>
<aclass="ansibleOptionLink"href="#parameter-main--prometheus_web_listen_address"title="Permalink to this option"></a><pclass="ansible-option-type-line"><spanclass="ansible-option-type">string</span></p>
</div></td>
<td><divclass="ansible-option-cell"><p>Address on which prometheus will be listening</p>