Merge pull request #1839 from ceph/colonwq-update-docker-rgw-exec

Update ceph_rgw_docker_extra_env to add bind ip
pull/1844/head
Sébastien Han 2017-08-31 19:47:16 +02:00 committed by GitHub
commit 673938ec96
3 changed files with 49 additions and 26 deletions

View File

@ -25,6 +25,7 @@ dummy:
#rgw_pull_port: "{{ radosgw_civetweb_port }}"
#rgw_pull_proto: "http"
########
#TUNING#
########
@ -33,7 +34,7 @@ dummy:
# important to split them into shards. We suggest about 100K
# objects per shard as a conservative maximum.
#rgw_override_bucket_index_max_shards: 16
#
# Consider setting a quota on buckets so that exceeding this
# limit will require admin intervention.
#rgw_bucket_default_quota_max_objects: 1638400 # i.e., 100K * 16
@ -51,12 +52,12 @@ dummy:
# foo:
# pg_num: 4
##########
# DOCKER #
##########
#ceph_rgw_civetweb_port: "{{ radosgw_civetweb_port }}"
#ceph_rgw_docker_extra_env: -e CLUSTER={{ cluster }} -e RGW_CIVETWEB_PORT={{ ceph_rgw_civetweb_port }}
#ceph_rgw_docker_extra_env:
#ceph_config_keys: [] # DON'T TOUCH ME
#rgw_config_keys: "/" # DON'T TOUCH ME

View File

@ -17,6 +17,7 @@ copy_admin_key: false
rgw_pull_port: "{{ radosgw_civetweb_port }}"
rgw_pull_proto: "http"
########
#TUNING#
########
@ -43,12 +44,12 @@ rgw_pull_proto: "http"
# foo:
# pg_num: 4
##########
# DOCKER #
##########
ceph_rgw_civetweb_port: "{{ radosgw_civetweb_port }}"
ceph_rgw_docker_extra_env: -e CLUSTER={{ cluster }} -e RGW_CIVETWEB_PORT={{ ceph_rgw_civetweb_port }}
ceph_rgw_docker_extra_env:
ceph_config_keys: [] # DON'T TOUCH ME
rgw_config_keys: "/" # DON'T TOUCH ME

View File

@ -15,11 +15,32 @@ ExecStart=/usr/bin/docker run --rm --net=host \
-e KV_IP={{ kv_endpoint }} \
-e KV_PORT={{ kv_port }} \
{% endif -%}
{% if radosgw_address_block | length > 0 %}
{% if ip_version == 'ipv4' -%}
-e RGW_CIVETWEB_IP={{ hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }} \
{%- elif ip_version == 'ipv6' -%}
-e RGW_CIVETWEB_IP=[{{ hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}] \
{%- endif %}
{% elif hostvars[inventory_hostname]['radosgw_address'] is defined and hostvars[inventory_hostname]['radosgw_address'] != '0.0.0.0' -%}
{% if ip_version == 'ipv4' -%}
-e RGW_CIVETWEB_IP={{ hostvars[inventory_hostname]['radosgw_address'] }} \
{%- elif ip_version == 'ipv6' -%}
-e RGW_CIVETWEB_IP=[{{ hostvars[inventory_hostname]['radosgw_address'] }}] \
{% endif %}
{%- else -%}
{% set interface = ["ansible_",radosgw_interface]|join %}
{% if ip_version == 'ipv6' -%}
-e RGW_CIVETWEB_IP=[{{ hostvars[inventory_hostname][interface][ip_version][0]['address'] }}] \
{%- elif ip_version == 'ipv4' -%}
-e RGW_CIVETWEB_IP={{ hostvars[inventory_hostname][interface][ip_version]['address'] }} \
{% endif %}
{%- endif %}
-v /etc/localtime:/etc/localtime:ro \
--privileged \
-e CEPH_DAEMON=RGW \
{{ ceph_rgw_docker_extra_env }} \
-e CLUSTER={{ cluster }} \
-e RGW_CIVETWEB_PORT={{ radosgw_civetweb_port }} \
--name=ceph-rgw-{{ ansible_hostname }} \
{{ ceph_rgw_docker_extra_env }} \
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
ExecStopPost=-/usr/bin/docker stop ceph-rgw-{{ ansible_hostname }}
Restart=always