Merge "Skip hosts group in ceph-ansible inventory when all are blacklisted"
This commit is contained in:
commit
c1f8345cf4
@ -382,24 +382,23 @@ outputs:
|
||||
content: |
|
||||
{%- set ceph_groups = ['mgr', 'mon', 'osd', 'mds', 'rgw', 'nfs', 'rbdmirror', 'client'] -%}
|
||||
{%- for ceph_group in ceph_groups -%}
|
||||
{%- if 'ceph_' ~ ceph_group in groups %}
|
||||
{%- if 'ceph_' ~ ceph_group in groups -%}
|
||||
{%- set ceph_group_hosts = groups['ceph_' ~ ceph_group] | difference(blacklisted_hostnames) -%}
|
||||
{%- if ceph_group_hosts|length > 0 %}
|
||||
|
||||
{{ ceph_group ~ 's:' }}
|
||||
hosts:
|
||||
{% for host in groups['ceph_' ~ ceph_group] -%}
|
||||
{%- if hostvars.raw_get(host)['ansible_hostname'] is defined -%}
|
||||
{%- if hostvars.raw_get(host)['ansible_hostname'] not in blacklisted_hostnames -%}
|
||||
{{ hostvars.raw_get(host)['ansible_hostname'] }}:
|
||||
{% for host in ceph_group_hosts -%}
|
||||
{{ host }}:
|
||||
ansible_user: {{ hostvars.raw_get(host)['ansible_ssh_user'] | default('root') }}
|
||||
ansible_host: {{ hostvars.raw_get(host)['ansible_host'] | default(host) }}
|
||||
ansible_become: true
|
||||
{% if hostvars.raw_get(host)['ansible_connection'] | default('') == 'local' -%}
|
||||
{% if hostvars.raw_get(host)['ansible_connection'] | default('') == 'local' -%}
|
||||
ansible_connection: local
|
||||
{% endif -%}
|
||||
{% endif -%}
|
||||
{% endif -%}
|
||||
{%- endfor -%}
|
||||
{%- endif %}
|
||||
{% endfor -%}
|
||||
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{%- endfor %}
|
||||
- name: set ceph-ansible group vars all
|
||||
|
Loading…
Reference in New Issue
Block a user