munin_server: ansible-lint fixes

This commit is contained in:
Timo Makinen 2022-10-30 17:41:51 +00:00
parent 916134add0
commit 77155a8157

View file

@ -1,16 +1,16 @@
--- ---
- name: install packages - name: Install packages
package: ansible.builtin.package:
name: munin name: munin
state: installed state: installed
- name: set file contexts for data directory - name: Set file contexts for data directory
sefcontext: community.general.sefcontext:
path: "/export/munin(/.*)?" path: "/export/munin(/.*)?"
setype: munin_var_lib_t setype: munin_var_lib_t
- name: create data direcory - name: Create data direcory
file: ansible.builtin.file:
path: /export/munin path: /export/munin
state: directory state: directory
mode: 0755 mode: 0755
@ -18,8 +18,8 @@
group: munin group: munin
setype: _default setype: _default
- name: link data directory - name: Link data directory
file: ansible.builtin.file:
dest: /srv/munin dest: /srv/munin
src: /export/munin src: /export/munin
state: link state: link
@ -28,29 +28,29 @@
follow: false follow: false
# for some reason this is owned by adm default # for some reason this is owned by adm default
- name: fix log directory group - name: Fix log directory group
file: ansible.builtin.file:
path: /var/log/munin path: /var/log/munin
state: directory state: directory
mode: 0750 mode: 0750
owner: munin owner: munin
group: apache group: apache
- name: add munin to hostkey group - name: Add munin to hostkey group
user: ansible.builtin.user:
name: munin name: munin
groups: hostkey groups: hostkey
append: true append: true
# this needs better rule # this needs better rule
- name: fix selinux write errors - name: Fix SELinux write errors
seboolean: ansible.posix.seboolean:
name: domain_can_mmap_files name: domain_can_mmap_files
state: true state: true
persistent: true persistent: true
- name: create apache config - name: Create apache config
copy: ansible.builtin.copy:
dest: /etc/httpd/conf.local.d/munin.conf dest: /etc/httpd/conf.local.d/munin.conf
src: munin-apache.conf src: munin-apache.conf
mode: 0644 mode: 0644
@ -58,21 +58,21 @@
group: "{{ ansible_wheel }}" group: "{{ ansible_wheel }}"
notify: restart apache notify: restart apache
- name: fix selinx contexts from cache directory - name: Fix SELinx contexts from cache directory
sefcontext: community.general.sefcontext:
path: "/var/run/munin/cgi-tmp(/.*)?" path: "/var/run/munin/cgi-tmp(/.*)?"
setype: munin_rw_content_t setype: munin_rw_content_t
- name: add cache direcory to tmpfiles - name: Add cache direcory to tmpfiles
copy: ansible.builtin.copy:
dest: /etc/tmpfiles.d/munin.conf dest: /etc/tmpfiles.d/munin.conf
src: munin-tmpfiles.conf src: munin-tmpfiles.conf
mode: 0644 mode: 0644
owner: root owner: root
group: "{{ ansible_wheel }}" group: "{{ ansible_wheel }}"
- name: create cache directory - name: Create cache directory
file: ansible.builtin.file:
path: /var/run/munin/cgi-tmp path: /var/run/munin/cgi-tmp
state: directory state: directory
mode: 0755 mode: 0755
@ -80,37 +80,37 @@
group: apache group: apache
setype: _default setype: _default
- name: create tls config - name: Create tls config
template: ansible.builtin.template:
dest: /etc/munin/conf.d/00-tls.conf dest: /etc/munin/conf.d/00-tls.conf
src: tls.conf.j2 src: tls.conf.j2
mode: 0644 mode: 0644
owner: root owner: root
group: "{{ ansible_wheel }}" group: "{{ ansible_wheel }}"
- name: create host config - name: Create host config
template: ansible.builtin.template:
dest: /etc/munin/conf.d/hosts.conf dest: /etc/munin/conf.d/hosts.conf
src: hosts.conf.j2 src: hosts.conf.j2
mode: 0644 mode: 0644
owner: root owner: root
group: "{{ ansible_wheel }}" group: "{{ ansible_wheel }}"
- name: create override config - name: Create override config
copy: ansible.builtin.copy:
dest: /etc/munin/conf.d/00-override.conf dest: /etc/munin/conf.d/00-override.conf
src: override.conf src: override.conf
mode: 0644 mode: 0644
owner: root owner: root
group: "{{ ansible_wheel }}" group: "{{ ansible_wheel }}"
- name: remove localhost node - name: Remove localhost node
file: ansible.builtin.file:
path: /etc/munin/conf.d/local.conf path: /etc/munin/conf.d/local.conf
state: absent state: absent
- name: enable cron job - name: Enable cron job
systemd: ansible.builtin.systemd:
name: munin.timer name: munin.timer
state: started state: started
enabled: true enabled: true