Browse Source

adding checking for prometheus_operator_enabled

pull/2547/head
Vladimir Vasilkin 6 years ago
parent
commit
760ca1c3a9
1 changed files with 3 additions and 0 deletions
  1. 3
      roles/kubernetes-apps/metrics/tasks/main.yml

3
roles/kubernetes-apps/metrics/tasks/main.yml

@ -2,11 +2,13 @@
- name: Metrics | Make sure Helm is installed - name: Metrics | Make sure Helm is installed
command: "{{ bin_dir }}/helm version" command: "{{ bin_dir }}/helm version"
when: when:
- prometheus_operator_enabled
- inventory_hostname == groups['kube-master'][0] - inventory_hostname == groups['kube-master'][0]
- name: Metrics | Add coreos repo - name: Metrics | Add coreos repo
command: "{{ bin_dir }}/helm repo add coreos https://s3-eu-west-1.amazonaws.com/coreos-charts/stable/" command: "{{ bin_dir }}/helm repo add coreos https://s3-eu-west-1.amazonaws.com/coreos-charts/stable/"
when: when:
- prometheus_operator_enabled
- inventory_hostname == groups['kube-master'][0] - inventory_hostname == groups['kube-master'][0]
run_once: true run_once: true
@ -20,6 +22,7 @@
- name: Metrics | Install K8s cluster metrics - name: Metrics | Install K8s cluster metrics
command: "{{ bin_dir }}/helm upgrade --install kube-prometheus coreos/kube-prometheus --namespace {{ monitoring_namespace }}" command: "{{ bin_dir }}/helm upgrade --install kube-prometheus coreos/kube-prometheus --namespace {{ monitoring_namespace }}"
when: when:
- prometheus_operator_enabled
- k8s_metrics_enabled - k8s_metrics_enabled
- inventory_hostname == groups['kube-master'][0] - inventory_hostname == groups['kube-master'][0]
run_once: true run_once: true
Loading…
Cancel
Save