Merge pull request #1666 from ceph/ceph-conf-interfaces

use host specific value for monitor_interface in ceph.conf creation
pull/1673/head
Guits 2017-07-12 20:38:59 +02:00 committed by GitHub
commit 49de6f9a5b
3 changed files with 6 additions and 5 deletions

View File

@ -33,8 +33,10 @@
tags:
- package-install
- name: make sure monitor_interface is defined
- name: make sure monitor_interface or monitor_address is defined
fail:
msg: "you must set monitor_interface"
msg: "you must set monitor_interface or monitor_address"
when:
- monitor_interface == 'interface'
- monitor_address == "0.0.0.0"
- mon_group_name in group_names

View File

@ -46,9 +46,9 @@ mon host = {% for host in groups[mon_group_name] -%}
{%- endif %}
{%- else -%}
{% if ip_version == 'ipv4' -%}
{{ hostvars[host]['ansible_' + monitor_interface][ip_version]['address'] }}
{{ hostvars[host]['ansible_' + hostvars[host]['monitor_interface']][ip_version]['address'] }}
{%- elif ip_version == 'ipv6' -%}
[{{ hostvars[host]['ansible_' + monitor_interface][ip_version][0]['address'] }}]
[{{ hostvars[host]['ansible_' + hostvars[host]['monitor_interface']][ip_version][0]['address'] }}]
{%- endif %}
{%- endif %}
{% if not loop.last -%},{%- endif %}

View File

@ -4,7 +4,6 @@ ceph_stable: True
cluster: test
public_network: "192.168.1.0/24"
cluster_network: "192.168.2.0/24"
monitor_interface: eth1
journal_size: 100
osd_objectstore: "filestore"
devices: