From aad99ffaad9677f0d22494364a28c0f04fbc37fb Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Tue, 11 Jun 2019 18:36:17 +0200
Subject: [PATCH] ansible-playbooks/general#85 Linting

---
 defaults/main.yml   |  4 +++-
 tasks/configure.yml |  4 ++--
 tasks/heartbeat.yml |  2 +-
 tasks/install.yml   |  2 +-
 tasks/main.yml      | 32 ++++++++++++++++----------------
 tasks/mysql.yml     |  6 +++---
 tasks/silent.yml    |  4 ++--
 7 files changed, 28 insertions(+), 26 deletions(-)

diff --git a/defaults/main.yml b/defaults/main.yml
index 6c95672..b472dcd 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -1,5 +1,7 @@
+---
+
 netdata_version: v1.15.0
-netdata_force_reset: false
+netdata_force_reset: no
 netdata_fluentd_buffer:
   green: 75
   red: 100
diff --git a/tasks/configure.yml b/tasks/configure.yml
index fe52933..7a40929 100644
--- a/tasks/configure.yml
+++ b/tasks/configure.yml
@@ -65,8 +65,8 @@
 - name: Patch Startup Script
   lineinfile:
     dest: /etc/init.d/netdata
-    regexp: killproc -p \$\{PIDFILE\} \$DAEMON_PATH/\$DAEMON
-    line:         killproc -p ${PIDFILE} $DAEMON_PATH/$DAEMON && sleep 3
+    regexp: 'killproc -p \$\{PIDFILE\} \$DAEMON_PATH/\$DAEMON'
+    line: '        killproc -p ${PIDFILE} $DAEMON_PATH/$DAEMON && sleep 3'
   when: ansible_lsb.major_release == '12'
 
 - name: Check if KSM is available
diff --git a/tasks/heartbeat.yml b/tasks/heartbeat.yml
index 5ea2784..a2b3db7 100644
--- a/tasks/heartbeat.yml
+++ b/tasks/heartbeat.yml
@@ -4,6 +4,6 @@
 - name: Crontab for heartbeat
   cron:
     name: Heartbeat
-    job: /usr/bin/curl -XPOST {{ netdata_alerta_webhook }}/heartbeat -H ''Authorization: Key {{ netdata_alerta_apikey }}'' -H ''Content-type: application/json'' -d ''{"origin":"{{ inventory_hostname }}","timeout":120,"tags":["environment:{{ netdata_alerta_environment|default(''production'') }}"]}'' >/dev/null 2>&1
+    job: '/usr/bin/curl -XPOST {{ netdata_alerta_webhook }}/heartbeat -H ''Authorization: Key {{ netdata_alerta_apikey }}'' -H ''Content-type: application/json'' -d ''{"origin":"{{ inventory_hostname }}","timeout":120,"tags":["environment:{{ netdata_alerta_environment|default(''production'') }}"]}'' >/dev/null 2>&1'
   tags:
     - cron
diff --git a/tasks/install.yml b/tasks/install.yml
index 3fc4aa3..b8f0e1b 100644
--- a/tasks/install.yml
+++ b/tasks/install.yml
@@ -3,7 +3,7 @@
 
 - name: Clone NetData
   git:
-    accept_hostkey: true
+    accept_hostkey: yes
     repo: "https://github.com/netdata/netdata.git"
     dest: "/opt/netdata"
     force: yes
diff --git a/tasks/main.yml b/tasks/main.yml
index 8d7c5f3..157cb51 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -9,30 +9,30 @@
 
 - block:
 
-  - import_tasks: prepare.yml
+    - import_tasks: prepare.yml
 
-  - import_tasks: install.yml
+    - import_tasks: install.yml
 
-  - import_tasks: configure.yml
+    - import_tasks: configure.yml
 
-  - import_tasks: apache.yml
-    when: groups['webserver'] is defined and inventory_hostname in groups['webserver']
+    - import_tasks: apache.yml
+      when: groups['webserver'] is defined and inventory_hostname in groups['webserver']
 
-  - import_tasks: elasticsearch.yml
-    when: groups['logserver'] is defined and inventory_hostname in groups['logserver']
+    - import_tasks: elasticsearch.yml
+      when: groups['logserver'] is defined and inventory_hostname in groups['logserver']
 
-  - import_tasks: haproxy.yml
-    when: groups['proxyserver'] is defined and inventory_hostname in groups['proxyserver']
+    - import_tasks: haproxy.yml
+      when: groups['proxyserver'] is defined and inventory_hostname in groups['proxyserver']
 
-  - import_tasks: mysql.yml
-    when: groups['dbserver_mysql'] is defined and inventory_hostname in groups['dbserver_mysql']
+    - import_tasks: mysql.yml
+      when: groups['dbserver_mysql'] is defined and inventory_hostname in groups['dbserver_mysql']
 
-  - import_tasks: silent.yml
+    - import_tasks: silent.yml
 
-  - import_tasks: varnish.yml
-    when: groups['varnishserver'] is defined and inventory_hostname in groups['varnishserver']
+    - import_tasks: varnish.yml
+      when: groups['varnishserver'] is defined and inventory_hostname in groups['varnishserver']
 
-  - import_tasks: heartbeat.yml
-    when: netdata_heartbeat|default(true)
+    - import_tasks: heartbeat.yml
+      when: netdata_heartbeat|default(true)
 
   when: not excluded_roles or "netdata" not in excluded_roles
diff --git a/tasks/mysql.yml b/tasks/mysql.yml
index f084cbd..005ea40 100644
--- a/tasks/mysql.yml
+++ b/tasks/mysql.yml
@@ -1,10 +1,10 @@
 ---
 # file: roles/netdata/tasks/mysql.yml
 
-- name: Configure Plugin: MySQL
+- name: Configure Plugin MySQL
   replace:
     dest: /usr/lib/netdata/conf.d/python.d/mysql.conf
-    regexp: #[\s]*pass[\s]*:[\s]*''''
-    replace: pass     : ''{{ mysql_root_password|default("root") }}''
+    regexp: '#[\s]*pass[\s]*:[\s]*'''''
+    replace: 'pass     : ''{{ mysql_root_password|default("root") }}'''
   notify:
     - Restart NetData
diff --git a/tasks/silent.yml b/tasks/silent.yml
index d637fa3..f0073a1 100644
--- a/tasks/silent.yml
+++ b/tasks/silent.yml
@@ -4,8 +4,8 @@
 - name: Make alerts silent
   replace:
     dest: /usr/lib/netdata/conf.d/health.d/{{ item }}.conf
-    regexp:  to: .*$
-    replace:  to: silent
+    regexp: ' to: .*$'
+    replace: ' to: silent'
     backup: yes
   with_items: '{{ netdata_silent_alerts }}'
   notify:
-- 
GitLab