grains and pillars and mine. fuck this shit.

This commit is contained in:
do
2020-02-21 19:59:36 +01:00
parent 21ffeb25df
commit e9e1b70201
5 changed files with 51 additions and 9 deletions

View File

@@ -1,18 +1,14 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
chaos-role:
- prometheus-node_exporter
prometheus:
wanted:
- node_exporter
service:
node_exporter:
args:
web.listen-address: ":9110"
web.listen-address: ":9100"
# collector.textfile.directory: /var/tmp/node_exporter
config:
prometheus:
scrape_configs:
- job_name: 'node'
static_configs:
- targets:
- {{ grains.get('fqdn') }}{{ salt['pillar.get']('prometheus:service:node_exporter:args:web.listen-address', ':9110') }}

View File

@@ -1,6 +1,10 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
chaos-role:
- prometheus-master
- prometheus-node_exporter
prometheus:
wanted:
- prometheus
@@ -10,3 +14,18 @@ prometheus:
prometheus:
args:
web.listen-address: 0.0.0.0:9090
config:
prometheus:
scrape_configs:
- job_name: 'node'
static_configs:
- targets:
- xxx
{% set roles = salt.saltutil.runner('mine.get',
tgt='*',
fun='chaos_roles',
tgt_type='glob'
) %}
- {{ roles.items() }}
- xxx
- {{ grains.get('fqdn') }}{{ salt['pillar.get']('prometheus:service:node_exporter:args:web.listen-address', ':9110') }}

6
salt/master.sls Normal file
View File

@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
chaos:
role:
- salt-master

View File

@@ -1,3 +1,18 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
mine_functions:
chaos_roles:
- mine_function: pillar.get
- chaos-role
disk.usage: []
grains.items: []
pillar.items: []
network.ip_addrs: [eth0]
networkplus.internal_ip_addrs: []
internal_ip_addrs:
mine_function: network.ip_addrs
cidr: 192.168.0.0/16
ip_list:
- mine_function: grains.get
- ip_interfaces

View File

@@ -1,6 +1,12 @@
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
base:
'*':
- saltmine
- prometheus.node_exporter
'pine02*':
- prometheus.prometheus
# 'tumor.chaos':
# - salt.master