Merge pull request #2150 from ceph/fix_typo

config: fix config generation
pull/2156/head
Guillaume Abrioux 2017-11-09 11:24:34 +01:00 committed by GitHub
commit 4c2d98f18c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 10 deletions

View File

@ -98,9 +98,9 @@ mon host = {% if nb_mon > 0 %}
{%- else -%} {%- else -%}
{% set interface = 'ansible_' + monitor_interface %} {% set interface = 'ansible_' + monitor_interface %}
{% if ip_version == 'ipv4' -%} {% if ip_version == 'ipv4' -%}
{{ [interface][ip_version]['address'] }} {{ hostvars[host][interface][ip_version]['address'] }}
{%- elif ip_version == 'ipv6' -%} {%- elif ip_version == 'ipv6' -%}
[{{ [interface][ip_version][0]['address'] }}] [{{ hostvars[host][interface][ip_version][0]['address'] }}]
{%- endif %} {%- endif %}
{%- endif %} {%- endif %}
{% if not loop.last -%},{%- endif %} {% if not loop.last -%},{%- endif %}
@ -195,16 +195,18 @@ rgw frontends = civetweb port={{ radosgw_address }}:{{ radosgw_civetweb_port }}
rgw frontends = civetweb port=[{{ radosgw_address }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }} rgw frontends = civetweb port=[{{ radosgw_address }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
{% endif %} {% endif %}
{% elif hostvars[host]['radosgw_interface'] is defined -%} {% elif hostvars[host]['radosgw_interface'] is defined -%}
{% set interface='ansible_' + hostvars[host]['radosgw_interface'] %}
{% if ip_version == 'ipv4' %} {% if ip_version == 'ipv4' %}
rgw frontends = civetweb port={{ hostvars[host]['ansible_' + hostvars[host]['radosgw_interface']][ip_version]['address'] }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }} rgw frontends = civetweb port={{ hostvars[host][interface][ip_version]['address'] }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
{% elif ip_version == 'ipv6' %} {% elif ip_version == 'ipv6' %}
rgw frontends = civetweb port=[{{ hostvars[host]['ansible_' + hostvars[host]['radosgw_interface']][ip_version][0]['address'] }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }} rgw frontends = civetweb port=[{{ hostvars[host][interface][ip_version][0]['address'] }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
{% endif %} {% endif %}
{% else %} {% else %}
{% set interface='ansible_' + radosgw_interface %}
{% if ip_version == 'ipv4' %} {% if ip_version == 'ipv4' %}
rgw frontends = civetweb port={{ ['ansible_' + radosgw_interface][ip_version]['address'] }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }} rgw frontends = civetweb port={{ hostvars[host][interface][ip_version]['address'] }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
{% elif ip_version == 'ipv6' %} {% elif ip_version == 'ipv6' %}
rgw frontends = civetweb port=[{{ ['ansible_' + radosgw_interface][ip_version][0]['address'] }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }} rgw frontends = civetweb port=[{{ hostvars[host][interface][ip_version][0]['address'] }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endif %} {% endif %}

View File

@ -51,9 +51,9 @@ ExecStart=/usr/bin/docker run --rm --name ceph-mon-%i --net=host \
{% else %} {% else %}
{% set interface = 'ansible_' + monitor_interface %} {% set interface = 'ansible_' + monitor_interface %}
{% if ip_version == 'ipv4' -%} {% if ip_version == 'ipv4' -%}
-e MON_IP={{ [interface][ip_version]['address'] }} \ -e MON_IP={{ hostvars[inventory_hostname][interface][ip_version]['address'] }} \
{% elif ip_version == 'ipv6' -%} {% elif ip_version == 'ipv6' -%}
-e MON_IP=[{{ [interface][ip_version][0]['address'] }}] \ -e MON_IP=[{{ hostvars[inventory_hostname][interface][ip_version][0]['address'] }}] \
{% endif -%} {% endif -%}
{%- endif %} {%- endif %}
-e CLUSTER={{ cluster }} \ -e CLUSTER={{ cluster }} \

View File

@ -55,9 +55,9 @@ ExecStart=/usr/bin/docker run --rm --net=host \
{% else %} {% else %}
{% set interface = 'ansible_' + radosgw_interface %} {% set interface = 'ansible_' + radosgw_interface %}
{% if ip_version == 'ipv4' %} {% if ip_version == 'ipv4' %}
-e RGW_CIVETWEB_IP={{ [interface][ip_version]['address'] }} \ -e RGW_CIVETWEB_IP={{ hostvars[inventory_hostname][interface][ip_version]['address'] }} \
{% elif ip_version == 'ipv6' %} {% elif ip_version == 'ipv6' %}
-e RGW_CIVETWEB_IP=[{{ [interface][ip_version][0]['address'] }}] \ -e RGW_CIVETWEB_IP=[{{ hostvars[inventory_hostname][interface][ip_version][0]['address'] }}] \
{% endif %} {% endif %}
{% endif %} {% endif %}
-v /etc/localtime:/etc/localtime:ro \ -v /etc/localtime:/etc/localtime:ro \