From a5775a9db664a7291d3d747dd297f72b2bd8094c Mon Sep 17 00:00:00 2001 From: MonsterDruide1 <5958456@gmail.com> Date: Sat, 2 Jul 2022 23:30:08 +0200 Subject: [PATCH 1/2] Add linting CI --- .gitlab-ci.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9bb1c3f..d348cf2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,17 +1,15 @@ --- 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 -- GitLab From b92732f6a88b6cf488b2ae3f31c288df1a711a40 Mon Sep 17 00:00:00 2001 From: MonsterDruide1 <5958456@gmail.com> Date: Sat, 2 Jul 2022 23:30:15 +0200 Subject: [PATCH 2/2] Fix ansible-lint --- handlers/main.yml | 2 +- meta/main.yml | 2 +- tasks/main.yml | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index 6951ed4..6259a55 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,3 +1,3 @@ --- - name: reload netdata alarms - command: killall -USR2 netdata + ansible.builtin.command: killall -USR2 netdata diff --git a/meta/main.yml b/meta/main.yml index d2949b4..fd35581 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -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: diff --git a/tasks/main.yml b/tasks/main.yml index d29072b..b623d20 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,6 +1,6 @@ --- - 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 }}\"" -- GitLab