Refact: remove ceph_mon_docker_interface variable

remove `ceph_mon_docker_interface` and use `monitor_interface` instead
for both containerized and non-containerized deployment.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
pull/1646/head
Guillaume Abrioux 2017-07-04 18:08:59 +02:00
parent f16037fac5
commit 896d62d78b
12 changed files with 13 additions and 15 deletions

2
Vagrantfile vendored
View File

@ -74,7 +74,7 @@ ansible_provision = proc do |ansible|
if DOCKER then
ansible.extra_vars = ansible.extra_vars.merge({
containerized_deployment: 'true',
ceph_mon_docker_interface: ETH,
monitor_interface: ETH,
ceph_mon_docker_subnet: "#{PUBLIC_SUBNET}.0/24",
ceph_osd_docker_devices: settings['disks'],
devices: settings['disks'],

View File

@ -87,8 +87,7 @@ dummy:
# DOCKER #
##########
#docker_exec_cmd:
#ceph_mon_docker_interface: "{{ monitor_interface }}"
#ceph_mon_docker_subnet: "{{ public_network }}"# subnet of the ceph_mon_docker_interface
#ceph_mon_docker_subnet: "{{ public_network }}"# subnet of the monitor_interface
#ceph_mon_docker_extra_env: -e CLUSTER={{ cluster }} -e FSID={{ fsid }} -e MON_NAME={{ monitor_name }}
#mon_docker_privileged: false
#mon_docker_net_host: true

View File

@ -150,7 +150,7 @@
net: "host"
state: "running"
privileged: "{{ mon_docker_privileged }}"
env: "MON_IP={{ hostvars[inventory_hostname]['ansible_' + ceph_mon_docker_interface]['ipv4']['address'] }},CEPH_DAEMON=MON,CEPH_PUBLIC_NETWORK={{ ceph_mon_docker_subnet }},CEPH_FSID={{ ceph_fsid.stdout }},{{ ceph_mon_docker_extra_env }}"
env: "MON_IP={{ hostvars[inventory_hostname]['ansible_' + monitor_interface]['ipv4']['address'] }},CEPH_DAEMON=MON,CEPH_PUBLIC_NETWORK={{ ceph_mon_docker_subnet }},CEPH_FSID={{ ceph_fsid.stdout }},{{ ceph_mon_docker_extra_env }}"
volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph,/etc/localtime:/etc/localtime:ro"
- name: waiting for the monitor to join the quorum...

View File

@ -71,7 +71,7 @@ mon host = {% for host in groups[mon_group_name] -%}
[{{ hostvars[host]['monitor_address'] }}]
{%- endif %}
{%- else -%}
{% set interface = ["ansible_",ceph_mon_docker_interface]|join %}
{% set interface = ["ansible_",monitor_interface]|join %}
{% if ip_version == 'ipv4' -%}
{{ hostvars[host][interface][ip_version]['address'] }}
{%- elif ip_version == 'ipv6' -%}

View File

@ -79,8 +79,7 @@ openstack_keys:
# DOCKER #
##########
docker_exec_cmd:
ceph_mon_docker_interface: "{{ monitor_interface }}"
ceph_mon_docker_subnet: "{{ public_network }}"# subnet of the ceph_mon_docker_interface
ceph_mon_docker_subnet: "{{ public_network }}"# subnet of the monitor_interface
ceph_mon_docker_extra_env: -e CLUSTER={{ cluster }} -e FSID={{ fsid }} -e MON_NAME={{ monitor_name }}
mon_docker_privileged: false
mon_docker_net_host: true

View File

@ -13,7 +13,7 @@
until: monitor_socket.rc == 0
- name: force peer addition as potential bootstrap peer for cluster bringup
command: docker exec ceph-mon-{{ ansible_hostname }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ monitor_name }}.asok add_bootstrap_peer_hint {{ hostvars[item]['ansible_' + ceph_mon_docker_interface].ipv4.address }}
command: docker exec ceph-mon-{{ ansible_hostname }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ monitor_name }}.asok add_bootstrap_peer_hint {{ hostvars[item]['ansible_' + monitor_interface].ipv4.address }}
with_items: "{{ groups[mon_group_name] }}"
changed_when: false
failed_when: false

View File

@ -32,9 +32,9 @@ ExecStart=/usr/bin/docker run --rm --name ceph-mon-%i --net=host \
-e MON_IP=[{{ monitor_address }}] \
{% endif -%}
{% elif ip_version == 'ipv4' -%}
-e MON_IP={{ hostvars[inventory_hostname]['ansible_' + ceph_mon_docker_interface][ip_version]['address'] }} \
-e MON_IP={{ hostvars[inventory_hostname]['ansible_' + monitor_interface][ip_version]['address'] }} \
{% elif ip_version =='ipv6' -%}
-e MON_IP=[{{ hostvars[inventory_hostname]['ansible_' + ceph_mon_docker_interface][ip_version][0]['address'] }}] \
-e MON_IP=[{{ hostvars[inventory_hostname]['ansible_' + monitor_interface][ip_version][0]['address'] }}] \
{% endif -%}
{{ ceph_mon_docker_extra_env }} \
{{ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}

View File

@ -73,7 +73,7 @@ ansible_provision = proc do |ansible|
if DOCKER then
ansible.extra_vars = ansible.extra_vars.merge({
containerized_deployment: 'true',
ceph_mon_docker_interface: ETH,
monitor_interface: ETH,
ceph_mon_docker_subnet: "#{PUBLIC_SUBNET}.0/24",
ceph_osd_docker_devices: settings['disks'],
devices: settings['disks'],

View File

@ -6,7 +6,7 @@ docker: True
ceph_stable: True
containerized_deployment: True
cluster: test
ceph_mon_docker_interface: eth1
monitor_interface: eth1
ceph_mon_docker_subnet: "{{ public_network }}"
journal_size: 100
ceph_docker_on_openstack: False

View File

@ -73,7 +73,7 @@ ansible_provision = proc do |ansible|
if DOCKER then
ansible.extra_vars = ansible.extra_vars.merge({
containerized_deployment: 'true',
ceph_mon_docker_interface: ETH,
monitor_interface: ETH,
ceph_mon_docker_subnet: "#{PUBLIC_SUBNET}.0/24",
ceph_osd_docker_devices: settings['disks'],
devices: settings['disks'],

View File

@ -6,7 +6,7 @@ docker: True
ceph_stable: True
containerized_deployment: True
cluster: ceph
ceph_mon_docker_interface: eth1
monitor_interface: eth1
ceph_mon_docker_subnet: "{{ public_network }}"
journal_size: 100
ceph_docker_on_openstack: False

View File

@ -6,7 +6,7 @@ docker: True
ceph_stable: True
containerized_deployment: True
cluster: test
ceph_mon_docker_interface: eth1
monitor_interface: eth1
ceph_mon_docker_subnet: "{{ public_network }}"
journal_size: 100
ceph_docker_on_openstack: False