Fix lint errors
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
Adrien Reslinger 2022-07-23 00:04:53 +02:00
parent 2c55153c74
commit 46a65e87df
Signed by: adrien
GPG key ID: DA7B27055C66D6DE
2 changed files with 93 additions and 93 deletions

View file

@ -6,6 +6,6 @@ galaxy_info:
galaxy_tags: []
license: GPL2
platforms:
- name: kubernetes
version:
- all
- name: kubernetes
version:
- all

View file

@ -3,103 +3,103 @@
- name: monitoring setup
block:
- name: Include vars files list
include_vars: "{{ item }}"
with_items:
- "prometheus_files_list.yml"
- "grafana_files_list.yml"
- name: Include vars files list
ansible.builtin.include_vars: "{{ item }}"
with_items:
- "prometheus_files_list.yml"
- "grafana_files_list.yml"
- name: Find state of monitoring stack
set_fact:
monitoring_state: absent
when:
- prometheus_state == "absent"
- grafana_state == "absent"
- name: Find state of monitoring stack
ansible.builtin.set_fact:
monitoring_state: absent
when:
- prometheus_state == "absent"
- grafana_state == "absent"
- name: namespace
k8s:
state: "{{ monitoring_state }}"
context: "{{ my_context }}"
name: "{{ monitoring_namespace }}"
api_version: v1
kind: Namespace
when:
- monitoring_state == "present"
- name: namespace
kubernetes.core.k8s:
state: "{{ monitoring_state }}"
context: "{{ my_context }}"
name: "{{ monitoring_namespace }}"
api_version: v1
kind: Namespace
when:
- monitoring_state == "present"
# - name: Create a Secret object for basic authentification
# k8s:
# state: "{{ prometheus_state }}"
# context: "{{ my_context }}"
# definition:
# apiVersion: v1
# kind: Secret
# metadata:
# name: basic-auth
# namespace: "{{ monitoring_namespace }}"
# type: Opaque
# data:
# basic_auth: "{{ basic_auth_data | b64encode }}"
# when:
# - basic_auth == true
# tags: prom
# - name: Create a Secret object for basic authentification
# kubernetes.core.k8s:
# state: "{{ prometheus_state }}"
# context: "{{ my_context }}"
# definition:
# apiVersion: v1
# kind: Secret
# metadata:
# name: basic-auth
# namespace: "{{ monitoring_namespace }}"
# type: Opaque
# data:
# basic_auth: "{{ basic_auth_data | b64encode }}"
# when:
# - basic_auth == true
# tags: prom
- name: Install Prometheus files
k8s:
state: "present"
context: "{{ my_context }}"
merge_type: merge
resource_definition: "{{ lookup('template', item) | from_yaml }}"
with_items:
- "{{ prometheus_files }}"
when:
- prometheus_state == "present"
tags: prometheus
- name: Install Prometheus files
kubernetes.core.k8s:
state: "present"
context: "{{ my_context }}"
merge_type: merge
resource_definition: "{{ lookup('template', item) | from_yaml }}"
with_items:
- "{{ prometheus_files }}"
when:
- prometheus_state == "present"
tags: prometheus
- name: UnInstall Prometheus files
k8s:
state: "absent"
context: "{{ my_context }}"
merge_type: merge
resource_definition: "{{ lookup('template', item) | from_yaml }}"
with_items:
- "{{ prometheus_files | reverse | list }}"
when:
- prometheus_state == "absent"
tags: prometheus
- name: UnInstall Prometheus files
kubernetes.core.k8s:
state: "absent"
context: "{{ my_context }}"
merge_type: merge
resource_definition: "{{ lookup('template', item) | from_yaml }}"
with_items:
- "{{ prometheus_files | reverse | list }}"
when:
- prometheus_state == "absent"
tags: prometheus
- name: Install Grafana files
k8s:
state: "present"
context: "{{ my_context }}"
merge_type: merge
resource_definition: "{{ lookup('template', item) | from_yaml }}"
with_items:
- "{{ grafana_files }}"
when:
- grafana_state == "present"
tags: grafana
- name: Install Grafana files
kubernetes.core.k8s:
state: "present"
context: "{{ my_context }}"
merge_type: merge
resource_definition: "{{ lookup('template', item) | from_yaml }}"
with_items:
- "{{ grafana_files }}"
when:
- grafana_state == "present"
tags: grafana
- name: UnInstall Grafana files
k8s:
state: "absent"
context: "{{ my_context }}"
merge_type: merge
resource_definition: "{{ lookup('template', item) | from_yaml }}"
with_items:
- "{{ grafana_files | reverse | list }}"
when:
- grafana_state == "absent"
tags: grafana
- name: UnInstall Grafana files
kubernetes.core.k8s:
state: "absent"
context: "{{ my_context }}"
merge_type: merge
resource_definition: "{{ lookup('template', item) | from_yaml }}"
with_items:
- "{{ grafana_files | reverse | list }}"
when:
- grafana_state == "absent"
tags: grafana
- name: namespace
k8s:
state: "{{ monitoring_state }}"
context: "{{ my_context }}"
name: "{{ monitoring_namespace }}"
api_version: v1
kind: Namespace
when:
- monitoring_state == "absent"
- name: namespace
kubernetes.core.k8s:
state: "{{ monitoring_state }}"
context: "{{ my_context }}"
name: "{{ monitoring_namespace }}"
api_version: v1
kind: Namespace
when:
- monitoring_state == "absent"
tags:
- monitoring