Fix lint errors
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
parent
2c55153c74
commit
46a65e87df
2 changed files with 93 additions and 93 deletions
|
|
@ -6,6 +6,6 @@ galaxy_info:
|
||||||
galaxy_tags: []
|
galaxy_tags: []
|
||||||
license: GPL2
|
license: GPL2
|
||||||
platforms:
|
platforms:
|
||||||
- name: kubernetes
|
- name: kubernetes
|
||||||
version:
|
version:
|
||||||
- all
|
- all
|
||||||
|
|
|
||||||
178
tasks/main.yml
178
tasks/main.yml
|
|
@ -3,103 +3,103 @@
|
||||||
|
|
||||||
- name: monitoring setup
|
- name: monitoring setup
|
||||||
block:
|
block:
|
||||||
- name: Include vars files list
|
- name: Include vars files list
|
||||||
include_vars: "{{ item }}"
|
ansible.builtin.include_vars: "{{ item }}"
|
||||||
with_items:
|
with_items:
|
||||||
- "prometheus_files_list.yml"
|
- "prometheus_files_list.yml"
|
||||||
- "grafana_files_list.yml"
|
- "grafana_files_list.yml"
|
||||||
|
|
||||||
- name: Find state of monitoring stack
|
- name: Find state of monitoring stack
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
monitoring_state: absent
|
monitoring_state: absent
|
||||||
when:
|
when:
|
||||||
- prometheus_state == "absent"
|
- prometheus_state == "absent"
|
||||||
- grafana_state == "absent"
|
- grafana_state == "absent"
|
||||||
|
|
||||||
- name: namespace
|
- name: namespace
|
||||||
k8s:
|
kubernetes.core.k8s:
|
||||||
state: "{{ monitoring_state }}"
|
state: "{{ monitoring_state }}"
|
||||||
context: "{{ my_context }}"
|
context: "{{ my_context }}"
|
||||||
name: "{{ monitoring_namespace }}"
|
name: "{{ monitoring_namespace }}"
|
||||||
api_version: v1
|
api_version: v1
|
||||||
kind: Namespace
|
kind: Namespace
|
||||||
when:
|
when:
|
||||||
- monitoring_state == "present"
|
- monitoring_state == "present"
|
||||||
|
|
||||||
# - name: Create a Secret object for basic authentification
|
# - name: Create a Secret object for basic authentification
|
||||||
# k8s:
|
# kubernetes.core.k8s:
|
||||||
# state: "{{ prometheus_state }}"
|
# state: "{{ prometheus_state }}"
|
||||||
# context: "{{ my_context }}"
|
# context: "{{ my_context }}"
|
||||||
# definition:
|
# definition:
|
||||||
# apiVersion: v1
|
# apiVersion: v1
|
||||||
# kind: Secret
|
# kind: Secret
|
||||||
# metadata:
|
# metadata:
|
||||||
# name: basic-auth
|
# name: basic-auth
|
||||||
# namespace: "{{ monitoring_namespace }}"
|
# namespace: "{{ monitoring_namespace }}"
|
||||||
# type: Opaque
|
# type: Opaque
|
||||||
# data:
|
# data:
|
||||||
# basic_auth: "{{ basic_auth_data | b64encode }}"
|
# basic_auth: "{{ basic_auth_data | b64encode }}"
|
||||||
# when:
|
# when:
|
||||||
# - basic_auth == true
|
# - basic_auth == true
|
||||||
# tags: prom
|
# tags: prom
|
||||||
|
|
||||||
- name: Install Prometheus files
|
- name: Install Prometheus files
|
||||||
k8s:
|
kubernetes.core.k8s:
|
||||||
state: "present"
|
state: "present"
|
||||||
context: "{{ my_context }}"
|
context: "{{ my_context }}"
|
||||||
merge_type: merge
|
merge_type: merge
|
||||||
resource_definition: "{{ lookup('template', item) | from_yaml }}"
|
resource_definition: "{{ lookup('template', item) | from_yaml }}"
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ prometheus_files }}"
|
- "{{ prometheus_files }}"
|
||||||
when:
|
when:
|
||||||
- prometheus_state == "present"
|
- prometheus_state == "present"
|
||||||
tags: prometheus
|
tags: prometheus
|
||||||
|
|
||||||
- name: UnInstall Prometheus files
|
- name: UnInstall Prometheus files
|
||||||
k8s:
|
kubernetes.core.k8s:
|
||||||
state: "absent"
|
state: "absent"
|
||||||
context: "{{ my_context }}"
|
context: "{{ my_context }}"
|
||||||
merge_type: merge
|
merge_type: merge
|
||||||
resource_definition: "{{ lookup('template', item) | from_yaml }}"
|
resource_definition: "{{ lookup('template', item) | from_yaml }}"
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ prometheus_files | reverse | list }}"
|
- "{{ prometheus_files | reverse | list }}"
|
||||||
when:
|
when:
|
||||||
- prometheus_state == "absent"
|
- prometheus_state == "absent"
|
||||||
tags: prometheus
|
tags: prometheus
|
||||||
|
|
||||||
- name: Install Grafana files
|
- name: Install Grafana files
|
||||||
k8s:
|
kubernetes.core.k8s:
|
||||||
state: "present"
|
state: "present"
|
||||||
context: "{{ my_context }}"
|
context: "{{ my_context }}"
|
||||||
merge_type: merge
|
merge_type: merge
|
||||||
resource_definition: "{{ lookup('template', item) | from_yaml }}"
|
resource_definition: "{{ lookup('template', item) | from_yaml }}"
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ grafana_files }}"
|
- "{{ grafana_files }}"
|
||||||
when:
|
when:
|
||||||
- grafana_state == "present"
|
- grafana_state == "present"
|
||||||
tags: grafana
|
tags: grafana
|
||||||
|
|
||||||
- name: UnInstall Grafana files
|
- name: UnInstall Grafana files
|
||||||
k8s:
|
kubernetes.core.k8s:
|
||||||
state: "absent"
|
state: "absent"
|
||||||
context: "{{ my_context }}"
|
context: "{{ my_context }}"
|
||||||
merge_type: merge
|
merge_type: merge
|
||||||
resource_definition: "{{ lookup('template', item) | from_yaml }}"
|
resource_definition: "{{ lookup('template', item) | from_yaml }}"
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ grafana_files | reverse | list }}"
|
- "{{ grafana_files | reverse | list }}"
|
||||||
when:
|
when:
|
||||||
- grafana_state == "absent"
|
- grafana_state == "absent"
|
||||||
tags: grafana
|
tags: grafana
|
||||||
|
|
||||||
- name: namespace
|
- name: namespace
|
||||||
k8s:
|
kubernetes.core.k8s:
|
||||||
state: "{{ monitoring_state }}"
|
state: "{{ monitoring_state }}"
|
||||||
context: "{{ my_context }}"
|
context: "{{ my_context }}"
|
||||||
name: "{{ monitoring_namespace }}"
|
name: "{{ monitoring_namespace }}"
|
||||||
api_version: v1
|
api_version: v1
|
||||||
kind: Namespace
|
kind: Namespace
|
||||||
when:
|
when:
|
||||||
- monitoring_state == "absent"
|
- monitoring_state == "absent"
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
- monitoring
|
- monitoring
|
||||||
Loading…
Add table
Add a link
Reference in a new issue