ansible/roles/influxdb/tasks/main.yaml

46 lines
1.2 KiB
YAML
Raw Permalink Normal View History

2019-12-02 02:40:40 +00:00
---
- name: gather os specific variables
2022-08-31 03:19:06 +00:00
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
2019-12-02 02:40:40 +00:00
vars:
2022-08-31 03:19:06 +00:00
params:
2019-12-02 02:40:40 +00:00
files:
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml"
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
- "default.yaml"
paths:
- vars
- name: include os specific tasks
2022-08-31 03:19:06 +00:00
ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}"
2019-12-02 02:40:40 +00:00
vars:
2022-08-31 03:19:06 +00:00
params:
2019-12-02 02:40:40 +00:00
files:
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml"
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
- "default.yaml"
paths:
- tasks
- name: install package
package:
name: "{{ influxdb_package_name }}"
state: "{{ influxdb_package_state }}"
- name: configure
template:
src: influxdb.conf.j2
dest: /etc/influxdb/influxdb.conf
owner: root
group: root
mode: 0644
notify: reload influxdb
- name: manage service
service:
name: "{{ influxdb_service_name }}"
state: "{{ influxdb_service_state }}"
enabled: "{{ influxdb_service_enabled }}"
when: influxdb_package_state != "absent"