Skip to content
Snippets Groups Projects
Commit eaba0903 authored by David Mehren's avatar David Mehren
Browse files

Merge branch 'linting' into 'master'

Add ansible-lint and fix all warnings and errors

See merge request !2
parents 9dbce5db b92732f6
No related branches found
No related tags found
1 merge request!2Add ansible-lint and fix all warnings and errors
Pipeline #89595 passed
---
stages:
- linting
# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
paths:
- .cache
ansible-lint:
stage: linting
image: registry.gitlab.com/pipeline-components/ansible-lint:latest
before_script:
- pip3 install yamllint
image:
name: registry.gitlab.fachschaften.org/fsi-ansible/ci-docker-image:latest
entrypoint: [""]
script:
- ansible-lint .
- ansible-lint -v --offline
---
- name: reload netdata alarms
command: killall -USR2 netdata
ansible.builtin.command: killall -USR2 netdata
......@@ -3,7 +3,7 @@ galaxy_info:
author: Fachschaft Informatik, TU Dortmund
description: Install and configure a netdata server
license: MIT
min_ansible_version: 2.9
min_ansible_version: "2.9"
platforms:
- name: Ubuntu
versions:
......
---
- name: Copy netdata cofig
template:
ansible.builtin.template:
src: netdata.conf.j2
dest: /etc/netdata/netdata.conf
owner: root
......@@ -9,7 +9,7 @@
notify: restart netdata
- name: Copy netdata stream config
template:
ansible.builtin.template:
src: stream.conf.j2
dest: /etc/netdata/stream.conf
owner: root
......@@ -19,7 +19,7 @@
notify: restart netdata
- name: Copy health override config
copy:
ansible.builtin.copy:
src: "{{ item }}"
dest: /etc/netdata/health.d/
owner: root
......@@ -31,7 +31,7 @@
notify: reload netdata alarms
- name: Copy last_collected alert config
template:
ansible.builtin.template:
dest: "/etc/netdata/health.d/last_collected.conf"
src: "last_collected.conf.j2"
owner: root
......@@ -40,12 +40,12 @@
notify: reload netdata alarms
- name: Enable netdata
service:
ansible.builtin.service:
name: netdata
enabled: true
- name: Copy original health_alarm_notify.conf
copy:
ansible.builtin.copy:
src: /usr/lib/netdata/conf.d/health_alarm_notify.conf
remote_src: true
dest: /etc/netdata/health_alarm_notify.conf
......@@ -55,7 +55,7 @@
mode: 0644
- name: Set email sender
lineinfile:
ansible.builtin.lineinfile:
path: /etc/netdata/health_alarm_notify.conf
regexp: "^EMAIL_SENDER=\".*\""
line: "EMAIL_SENDER=\"{{ netdata_from_email }}\""
......@@ -63,7 +63,7 @@
notify: reload netdata alarms
- name: Set email recipient
lineinfile:
ansible.builtin.lineinfile:
path: /etc/netdata/health_alarm_notify.conf
regexp: "^DEFAULT_RECIPIENT_EMAIL=\".*\""
line: "DEFAULT_RECIPIENT_EMAIL=\"{{ netdata_to_email }}\""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment