diff --git a/Vagrantfile b/Vagrantfile index 19d93e8fc..3fa25cf3b 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -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'], diff --git a/group_vars/mons.yml.sample b/group_vars/mons.yml.sample index 8244d650e..4ed18e5b5 100644 --- a/group_vars/mons.yml.sample +++ b/group_vars/mons.yml.sample @@ -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 diff --git a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml index 5dcc196ce..adee1e971 100644 --- a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml +++ b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml @@ -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... diff --git a/roles/ceph-common/templates/ceph.conf.j2 b/roles/ceph-common/templates/ceph.conf.j2 index 1434ae240..eec6029c3 100644 --- a/roles/ceph-common/templates/ceph.conf.j2 +++ b/roles/ceph-common/templates/ceph.conf.j2 @@ -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' -%} diff --git a/roles/ceph-mon/defaults/main.yml b/roles/ceph-mon/defaults/main.yml index 629b8b924..e64de8a43 100644 --- a/roles/ceph-mon/defaults/main.yml +++ b/roles/ceph-mon/defaults/main.yml @@ -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 diff --git a/roles/ceph-mon/tasks/docker/main.yml b/roles/ceph-mon/tasks/docker/main.yml index 1f9130b8f..1a2f99a05 100644 --- a/roles/ceph-mon/tasks/docker/main.yml +++ b/roles/ceph-mon/tasks/docker/main.yml @@ -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 diff --git a/roles/ceph-mon/templates/ceph-mon.service.j2 b/roles/ceph-mon/templates/ceph-mon.service.j2 index 74457aa2e..a5f790f27 100644 --- a/roles/ceph-mon/templates/ceph-mon.service.j2 +++ b/roles/ceph-mon/templates/ceph-mon.service.j2 @@ -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 }} diff --git a/tests/functional/centos/7/docker-cluster-dedicated-journal/Vagrantfile b/tests/functional/centos/7/docker-cluster-dedicated-journal/Vagrantfile index 3fa4b55bf..0ba579791 100644 --- a/tests/functional/centos/7/docker-cluster-dedicated-journal/Vagrantfile +++ b/tests/functional/centos/7/docker-cluster-dedicated-journal/Vagrantfile @@ -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'], diff --git a/tests/functional/centos/7/docker-cluster-dedicated-journal/group_vars/all b/tests/functional/centos/7/docker-cluster-dedicated-journal/group_vars/all index e5950afc3..8bb92b26b 100644 --- a/tests/functional/centos/7/docker-cluster-dedicated-journal/group_vars/all +++ b/tests/functional/centos/7/docker-cluster-dedicated-journal/group_vars/all @@ -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 diff --git a/tests/functional/centos/7/docker-cluster-dmcrypt-journal-collocation/Vagrantfile b/tests/functional/centos/7/docker-cluster-dmcrypt-journal-collocation/Vagrantfile index 3fa4b55bf..0ba579791 100644 --- a/tests/functional/centos/7/docker-cluster-dmcrypt-journal-collocation/Vagrantfile +++ b/tests/functional/centos/7/docker-cluster-dmcrypt-journal-collocation/Vagrantfile @@ -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'], diff --git a/tests/functional/centos/7/docker-cluster-dmcrypt-journal-collocation/group_vars/all b/tests/functional/centos/7/docker-cluster-dmcrypt-journal-collocation/group_vars/all index 926e92d11..92e2b0f5a 100644 --- a/tests/functional/centos/7/docker-cluster-dmcrypt-journal-collocation/group_vars/all +++ b/tests/functional/centos/7/docker-cluster-dmcrypt-journal-collocation/group_vars/all @@ -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 diff --git a/tests/functional/centos/7/docker-cluster/group_vars/all b/tests/functional/centos/7/docker-cluster/group_vars/all index c9acef0a2..3a078510d 100644 --- a/tests/functional/centos/7/docker-cluster/group_vars/all +++ b/tests/functional/centos/7/docker-cluster/group_vars/all @@ -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