ansible/roles/collectd/server/tasks/main.yml
Ryan Lerch 62952df107 ansiblelint fixes-- fqcn[action-core] - file to ansible.builtin.file
Replaces many references to  file: with ansible.builtin.file

Signed-off-by: Ryan Lerch <rlerch@redhat.com>
2025-01-15 10:41:52 +10:00

106 lines
2.3 KiB
YAML

---
# collectd server setup
# install pkg
- name: Install collectd server packages (rhel 7)
package: name={{ item }} state=present
with_items:
- collectd-rrdtool
- collectd-web
- collectd-rabbitmq-data
notify:
- restart collectd
tags:
- config
- collectd/server
when: ansible_distribution_major_version|int == 7
- name: Install collectd server packages (rhel 8)
package: name={{ item }} state=present
with_items:
- collectd-rrdtool
- collectd-web
- collectd-rabbitmq-data
- collectd-ipa-data
notify:
- restart collectd
tags:
- config
- collectd/server
when: ansible_distribution_major_version|int == 8
# install collectd types
- name: Install collectd types
copy:
src: "{{ item }}"
dest: /usr/share/collectd/{{ item }}
loop:
- fmn-types.db
notify:
- restart collectd
tags:
- config
- collectd/server
# install collectd configs
- name: Install collectd config
copy:
src: "{{ item }}"
dest: /etc/collectd.d/{{ item }}
loop:
- rrdtool.conf
- fmn.conf
- unixsock.conf
notify:
- restart collectd
tags:
- config
- collectd/server
# install apache config
- name: Install collectd apache config
copy: src=collectd.conf dest=/etc/httpd/conf.d/collectd.conf
tags:
- config
- collectd/server
# install upgrade target
- name: Install collect upgrade target to handle v4 clients
copy: src=vfive-upgrade.conf dest=/etc/collectd.d/vfive-upgrade.conf
tags:
- config
- collectd/server
# create /var/log/collectd as it's on a larger volume
- name: Create /var/log/collectd
ansible.builtin.file: path=/var/log/collectd owner=root group=root mode=0755 state=directory
tags:
- config
- collectd/server
# push our custom config file for the graph CGIs
- name: Push the collection.conf file
copy:
src: collection.conf
dest: /etc/collection.conf
tags:
- config
- collectd/server
- name: Create the service configuration directory
ansible.builtin.file:
path: /etc/systemd/system/collectd.service.d
state: directory
tags:
- config
- collectd/server
- name: Override the timeout for stopping collectd
copy:
src: service.timeout.conf
dest: /etc/systemd/system/collectd.service.d/timeout.conf
notify:
- reload systemd
tags:
- config
- collectd/server