Skip to content
Snippets Groups Projects
Commit 862f047b authored by Maarten de Waard's avatar Maarten de Waard
Browse files

Merge branch '351-prometheus-installation-can-not-be-repeated' into 347-update-prometheus

parents 0b0ffe11 953d9439
No related branches found
No related tags found
No related merge requests found
......@@ -42,16 +42,25 @@
- name: Install control shell
hosts: master
roles:
- role: get_control
tags: ['get_control']
- role: configure_helmfile
tags: ['configure_helmfile']
- role: rke_configuration
tags: ['rke_configuration']
- role: setup
tags: ['setup']
- role: apps
tags: ['apps']
- role: finalize
tags: ['finalize']
tasks:
- name: Run everything
block:
- import_role:
name: get_control
tags: ['get_control']
- import_role:
name: configure_helmfile
tags: ['configure_helmfile']
- import_role:
name: rke_configuration
tags: ['rke_configuration']
- import_role:
name: setup
tags: ['setup']
- import_role:
name: apps
tags: ['apps']
always:
- import_role:
name: finalize
tags: ['finalize']
......@@ -44,6 +44,18 @@
with_items: "{{ helmfiles }}"
when: item is search("monitoring")
- name: Make Prometheus custom resource definitions
tags:
- helmfile
- monitoring
command: '/snap/bin/kubectl apply -f https://raw.githubusercontent.com/coreos/prometheus-operator/master/example/prometheus-operator-crd/{{ item }}'
loop:
- alertmanager.crd.yaml
- prometheus.crd.yaml
- prometheusrule.crd.yaml
- servicemonitor.crd.yaml
- podmonitor.crd.yaml
- name: Apply remaining helmfiles
tags:
- helmfile
......@@ -64,5 +76,10 @@
>> {{ log_directory }}/helmfile.log
args:
executable: /bin/bash
<<<<<<< HEAD
with_items: "{{ helmfiles }}"
when: item is not search("cert-manager") and item is not search("monitoring")
=======
loop: "{{ helmfiles }}"
when: item is not search("cert-manager")
>>>>>>> 351-prometheus-installation-can-not-be-repeated
......@@ -31,6 +31,9 @@ prometheus:
service:
type: NodePort
prometheusOperator:
createCustomResource: false
grafana:
adminPassword: "{{ requiredEnv "GRAFANA_ADMIN_PASSWORD" }}"
......
......@@ -67,9 +67,11 @@ def create_inventory(cluster):
'r') as stream:
inventory = yaml.safe_load(stream)
inventory['all']['hosts'][cluster.hostname] = \
inventory['all']['hosts']['oas-dev']
del inventory['all']['hosts']['oas-dev']
# Rename the hostname in the inventory to one provided by the user.
if cluster.hostname != 'oas-dev':
inventory['all']['hosts'][cluster.hostname] = \
inventory['all']['hosts']['oas-dev']
del inventory['all']['hosts']['oas-dev']
inventory['all']['hosts'][cluster.hostname]['ansible_host'] = \
cluster.ip_address
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment