Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing usage of group 'all' by dynamic generated group #248

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion ansible/playbook.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
---
- hosts: all
- hosts: localhost
connection: local
gather_facts: false
vars:
ceph_groups:
- ceph-grafana
# These are roles used by ceph-ansible
- mons
- agents
- osds
- mdss
- rgws
- nfss
- restapis
- rbdmirrors
- clients
- mgrs
- iscsis
# This role is (so far) only used for testing
- cluster
tasks:
- name: Creating one group containing all ceph groups - ceph_all
add_host:
name: "{{ item }}"
groups: "ceph_all"
loop: "{{ lookup('inventory_hostnames', ceph_groups|join(':'), wantlist=True) }}"

- hosts: ceph_all
gather_facts: true
any_errors_fatal: true
tags:
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/ceph-prometheus/templates/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ scrape_configs:
{% endfor %}
- job_name: 'node'
static_configs:
{% for host in (groups['all'] | difference(groups['ceph-grafana'])) %}
{% for host in (groups['ceph_all'] | difference(groups['ceph-grafana'])) %}
- targets: ['{{ host }}:9100']
labels:
instance: "{{ hostvars[host]['ansible_nodename'] }}"
Expand Down