xoxys.prometheus/tasks/prepare.yml
Robert Kaussow 29759df1c9
All checks were successful
continuous-integration/drone/push Build is passing
feat: add new variable prometheus_user_comment
2021-07-29 21:46:33 +02:00

37 lines
972 B
YAML

---
- name: Set current prometheus version
set_fact:
prometheus_current_version: "{{ (ansible_local.prometheus | default (dict(version='0.0.0')))['version'] }}"
- debug:
msg: Current version is '{{ prometheus_current_version }}'
- block:
- name: Create group '{{ prometheus_group }}'
group:
name: "{{ prometheus_group }}"
state: present
- name: Create user '{{ prometheus_user }}'
user:
comment: "{{ prometheus_user_comment }}"
name: "{{ prometheus_user }}"
home: "{{ prometheus_user_home }}"
group: "{{ prometheus_group }}"
groups: "{{ prometheus_extra_groups | join(',') }}"
- name: Install dependencies
package:
name: "{{ item }}"
state: present
loop:
- "{{ prometheus_packages }}"
- name: Setup local facts
file:
path: /etc/ansible/facts.d
state: directory
mode: 0755
become: True
become_user: root