]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Adds ip_version configuration option 1247/head
authorAndrew Schoen <aschoen@redhat.com>
Tue, 24 Jan 2017 15:06:10 +0000 (09:06 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Tue, 24 Jan 2017 15:48:55 +0000 (09:48 -0600)
This allows the user to set ip_version to either ipv4 or ipv6. This
resolves a bug where monitor_address is set to an ipv6 address, but the
template fails to render because it's hardcoded to look for an 'ipv4'
key in the ansible facts.

See: https://bugzilla.redhat.com/show_bug.cgi?id=1416010

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
Resolves: bz#1416010

group_vars/all.yml.sample
roles/ceph-common/defaults/main.yml
roles/ceph-common/templates/ceph.conf.j2

index 1a5fbd80af9c0ae088615da0976eefc1f455e579..90ee940b7c94a71cb7d1e55e6c4c9a5e12ec7641 100644 (file)
@@ -260,6 +260,8 @@ dummy:
 # will go to monitor_interface if both are defined.
 #monitor_interface: interface
 #monitor_address: 0.0.0.0
+# set to either ipv4 or ipv6, whichever your network is using
+#ip_version: ipv4
 #mon_use_fqdn: false # if set to true, the MON name used will be the fqdn in the ceph.conf
 #monitor_address_block: false
 
index 37d7f5f26701225052c598e42b4f6ab43f19bb3b..6190c49cce60bf14bd5cfd1ec1d7e1ef28d9f19b 100644 (file)
@@ -252,6 +252,8 @@ rbd_client_admin_socket_path: /var/run/ceph # must be writable by QEMU and allow
 # will go to monitor_interface if both are defined.
 monitor_interface: interface
 monitor_address: 0.0.0.0
+# set to either ipv4 or ipv6, whichever your network is using
+ip_version: ipv4
 mon_use_fqdn: false # if set to true, the MON name used will be the fqdn in the ceph.conf
 monitor_address_block: false
 
index 47b2776ac4c66c82dca047d7131f402ba7b45563..4ea159dd94bebce1236b2616bd7f70350c9f3dd2 100644 (file)
@@ -8,6 +8,9 @@ auth service required = none
 auth client required = none
 auth supported = none
 {% endif %}
+{% if ip_version == 'ipv6'  %}
+ms bind ipv6
+{% endif %}
 {% if not mon_containerized_deployment_with_kv and not mon_containerized_deployment %}
 fsid = {{ fsid }}
 {% endif %}
@@ -37,7 +40,7 @@ mon host = {% for host in groups[mon_group_name] %}
              {% if interface != "interface" %}
                {% for key in hostvars[host].keys() %}
                  {% if hostvars[host][key]['macaddress'] is defined and hostvars[host][key]['device'] is defined and hostvars[host][key]['device'] == interface -%}
-                    {{ hostvars[host][key]['ipv4']['address'] }}
+                    {{ hostvars[host][key][ip_version]['address'] }}
                  {%- endif %}
                {% endfor %}
              {% elif address != "0.0.0.0" -%}