diff --git a/defaults/main.yml b/defaults/main.yml index 481196d..bbae907 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -44,4 +44,6 @@ prometheus_config_flags: 'alertmanager.url': '{{ prometheus_alertmanager_url }}' prometheus_config_flags_extra: {} +prometheus_pam_domain: "prometheus" +prometheus_pam_nofile_value: "1024" diff --git a/tasks/main.yml b/tasks/main.yml index 4d76447..c12bfe3 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -106,6 +106,19 @@ notify: - restart prometheus +- name: change pam nofile limits for prometheus + pam_limits: + domain: "{{ prometheus_pam_domain }}" + limit_item: nofile + limit_type: "{{ item }}" + value: "{{ prometheus_pam_nofile_value }}" + use_max: yes + with_items: + - soft + - hard + notify: + - restart prometheus + - name: ensure prometheus service is enabled service: name: prometheus