From: Guillaume Abrioux Date: Mon, 9 Dec 2019 17:23:15 +0000 (+0100) Subject: defaults: change monitor|radosgw_address default values X-Git-Tag: v3.2.39~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=726b3f220b31b419e76a82a39baffd3f27eaad08;p=ceph-ansible.git defaults: change monitor|radosgw_address default values To avoid confusion, let's change the default value from `0.0.0.0` to `x.x.x.x`. Users might think setting `0.0.0.0` will make the daemon binding on all interfaces. Fixes: #4827 Signed-off-by: Guillaume Abrioux (cherry picked from commit fc02fc98ebce0f99e81628e76ad28e7bf65435de) --- diff --git a/group_vars/all.yml.sample b/group_vars/all.yml.sample index 3703c5614..a8e2d66cf 100644 --- a/group_vars/all.yml.sample +++ b/group_vars/all.yml.sample @@ -340,7 +340,7 @@ dummy: # Eg. If you want to specify for each monitor which address the monitor will bind to you can set it in your **inventory host file** by using 'monitor_address' variable. # Preference will go to monitor_address if both monitor_address and monitor_interface are defined. #monitor_interface: interface -#monitor_address: 0.0.0.0 +#monitor_address: x.x.x.x #monitor_address_block: subnet # set to either ipv4 or ipv6, whichever your network is using #ip_version: ipv4 @@ -408,7 +408,7 @@ dummy: # Eg. If you want to specify for each radosgw node which address the radosgw will bind to you can set it in your **inventory host file** by using 'radosgw_address' variable. # Preference will go to radosgw_address if both radosgw_address and radosgw_interface are defined. #radosgw_interface: interface -#radosgw_address: 0.0.0.0 +#radosgw_address: x.x.x.x #radosgw_address_block: subnet #radosgw_keystone_ssl: false # activate this when using keystone PKI keys # Rados Gateway options diff --git a/group_vars/rhcs.yml.sample b/group_vars/rhcs.yml.sample index dbef7afb3..36d29b3bf 100644 --- a/group_vars/rhcs.yml.sample +++ b/group_vars/rhcs.yml.sample @@ -340,7 +340,7 @@ ceph_rhcs_version: 3 # Eg. If you want to specify for each monitor which address the monitor will bind to you can set it in your **inventory host file** by using 'monitor_address' variable. # Preference will go to monitor_address if both monitor_address and monitor_interface are defined. #monitor_interface: interface -#monitor_address: 0.0.0.0 +#monitor_address: x.x.x.x #monitor_address_block: subnet # set to either ipv4 or ipv6, whichever your network is using #ip_version: ipv4 @@ -408,7 +408,7 @@ ceph_rhcs_version: 3 # Eg. If you want to specify for each radosgw node which address the radosgw will bind to you can set it in your **inventory host file** by using 'radosgw_address' variable. # Preference will go to radosgw_address if both radosgw_address and radosgw_interface are defined. #radosgw_interface: interface -#radosgw_address: 0.0.0.0 +#radosgw_address: x.x.x.x #radosgw_address_block: subnet #radosgw_keystone_ssl: false # activate this when using keystone PKI keys # Rados Gateway options diff --git a/roles/ceph-config/templates/ceph.conf.j2 b/roles/ceph-config/templates/ceph.conf.j2 index a6c0ccb37..09d326644 100644 --- a/roles/ceph-config/templates/ceph.conf.j2 +++ b/roles/ceph-config/templates/ceph.conf.j2 @@ -46,7 +46,7 @@ mon host = {% if nb_mon > 0 %} {%- elif ip_version == 'ipv6' -%} [{{ hostvars[host]['ansible_all_' + ip_version + '_addresses'] | ipaddr(hostvars[host]['monitor_address_block']) | last }}] {%- endif %} - {% elif hostvars[host]['monitor_address'] is defined and hostvars[host]['monitor_address'] != '0.0.0.0' -%} + {% elif hostvars[host]['monitor_address'] is defined and hostvars[host]['monitor_address'] != 'x.x.x.x' -%} {% if ip_version == 'ipv4' -%} {{ hostvars[host]['monitor_address'] }} {%- elif ip_version == 'ipv6' -%} @@ -86,7 +86,7 @@ mon host = {% if nb_mon > 0 %} {%- elif ip_version == 'ipv6' -%} [{{ hostvars[host]['ansible_all_' + ip_version + '_addresses'] | ipaddr(hostvars[host]['monitor_address_block']) | last }}] {%- endif %} - {% elif hostvars[host]['monitor_address'] is defined and hostvars[host]['monitor_address'] != '0.0.0.0' -%} + {% elif hostvars[host]['monitor_address'] is defined and hostvars[host]['monitor_address'] != 'x.x.x.x' -%} {% if ip_version == 'ipv4' -%} {{ hostvars[host]['monitor_address'] }} {%- elif ip_version == 'ipv6' -%} @@ -188,13 +188,13 @@ rgw frontends = {{ radosgw_frontend_type }} {{ 'port' if radosgw_frontend_type = {% elif ip_version == 'ipv6' %} rgw frontends = {{ radosgw_frontend_type }} {{ 'port' if radosgw_frontend_type == 'civetweb' else 'endpoint' }}=[{{ radosgw_address_block | ipaddr(radosgw_address_block) | last }}]:{{ radosgw_frontend_port }} {{ radosgw_frontend_options }} {% endif %} -{% elif hostvars[host]['radosgw_address'] is defined and hostvars[host]['radosgw_address'] != '0.0.0.0' -%} +{% elif hostvars[host]['radosgw_address'] is defined and hostvars[host]['radosgw_address'] != 'x.x.x.x' -%} {% if ip_version == 'ipv4' %} rgw frontends = {{ radosgw_frontend_type }} {{ 'port' if radosgw_frontend_type == 'civetweb' else 'endpoint' }}={{ hostvars[host]['radosgw_address'] }}:{{ radosgw_frontend_port }} {{ radosgw_frontend_options }} {% elif ip_version == 'ipv6' %} rgw frontends = {{ radosgw_frontend_type }} {{ 'port' if radosgw_frontend_type == 'civetweb' else 'endpoint' }}=[{{ hostvars[host]['radosgw_address'] }}]:{{ radosgw_frontend_port }} {{ radosgw_frontend_options }} {% endif %} -{% elif radosgw_address is defined and radosgw_address != '0.0.0.0' -%} +{% elif radosgw_address is defined and radosgw_address != 'x.x.x.x' -%} {% if ip_version == 'ipv4' %} rgw frontends = {{ radosgw_frontend_type }} {{ 'port' if radosgw_frontend_type == 'civetweb' else 'endpoint' }}={{ radosgw_address }}:{{ radosgw_frontend_port }} {{ radosgw_frontend_options }} {% elif ip_version == 'ipv6' %} diff --git a/roles/ceph-defaults/defaults/main.yml b/roles/ceph-defaults/defaults/main.yml index 014406067..cb7714152 100644 --- a/roles/ceph-defaults/defaults/main.yml +++ b/roles/ceph-defaults/defaults/main.yml @@ -332,7 +332,7 @@ rbd_client_admin_socket_path: /var/run/ceph # must be writable by QEMU and allow # Eg. If you want to specify for each monitor which address the monitor will bind to you can set it in your **inventory host file** by using 'monitor_address' variable. # Preference will go to monitor_address if both monitor_address and monitor_interface are defined. monitor_interface: interface -monitor_address: 0.0.0.0 +monitor_address: x.x.x.x monitor_address_block: subnet # set to either ipv4 or ipv6, whichever your network is using ip_version: ipv4 @@ -400,7 +400,7 @@ radosgw_thread_pool_size: 512 # Eg. If you want to specify for each radosgw node which address the radosgw will bind to you can set it in your **inventory host file** by using 'radosgw_address' variable. # Preference will go to radosgw_address if both radosgw_address and radosgw_interface are defined. radosgw_interface: interface -radosgw_address: 0.0.0.0 +radosgw_address: x.x.x.x radosgw_address_block: subnet radosgw_keystone_ssl: false # activate this when using keystone PKI keys # Rados Gateway options diff --git a/roles/ceph-docker-common/tasks/check_mandatory_vars.yml b/roles/ceph-docker-common/tasks/check_mandatory_vars.yml index 0114157bd..79e78f21d 100644 --- a/roles/ceph-docker-common/tasks/check_mandatory_vars.yml +++ b/roles/ceph-docker-common/tasks/check_mandatory_vars.yml @@ -5,7 +5,7 @@ when: - mon_group_name in group_names - monitor_interface == 'interface' - - monitor_address == "0.0.0.0" + - monitor_address == "x.x.x.x" - monitor_address_block == 'subnet' - name: make sure radosgw_interface, radosgw_address or radosgw_address_block is defined @@ -14,5 +14,5 @@ when: - rgw_group_name in group_names - radosgw_interface == 'interface' - - radosgw_address == '0.0.0.0' + - radosgw_address == 'x.x.x.x' - radosgw_address_block == 'subnet' diff --git a/roles/ceph-handler/templates/restart_rgw_daemon.sh.j2 b/roles/ceph-handler/templates/restart_rgw_daemon.sh.j2 index cda59d1f4..8ab89a3d5 100644 --- a/roles/ceph-handler/templates/restart_rgw_daemon.sh.j2 +++ b/roles/ceph-handler/templates/restart_rgw_daemon.sh.j2 @@ -29,7 +29,7 @@ RGW_IP={{ hostvars[inventory_hostname]['radosgw_address'] }} \ {% elif ip_version == 'ipv6' %} RGW_IP=[{{ hostvars[inventory_hostname]['radosgw_address'] }}] \ {% endif %} -{% elif radosgw_address is defined and radosgw_address != '0.0.0.0' -%} +{% elif radosgw_address is defined and radosgw_address != 'x.x.x.x' -%} {% if ip_version == 'ipv4' %} RGW_IP={{ radosgw_address }} \ {% elif ip_version == 'ipv6' %} diff --git a/roles/ceph-mon/tasks/docker/main.yml b/roles/ceph-mon/tasks/docker/main.yml index c240116ed..e5b943515 100644 --- a/roles/ceph-mon/tasks/docker/main.yml +++ b/roles/ceph-mon/tasks/docker/main.yml @@ -34,7 +34,7 @@ - not containerized_deployment_with_kv - ip_version == 'ipv4' - hostvars[groups[mon_group_name][0]]['monitor_address'] is defined - - hostvars[groups[mon_group_name][0]]['monitor_address'] != '0.0.0.0' + - hostvars[groups[mon_group_name][0]]['monitor_address'] != 'x.x.x.x' - name: ipv4 - force peer addition as potential bootstrap peer for cluster bringup - monitor_address_block command: "{{ docker_exec_cmd }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ monitor_name }}.asok add_bootstrap_peer_hint {{ hostvars[groups[mon_group_name][0]]['ansible_all_' + ip_version + '_addresses'] | ipaddr(monitor_address_block) | first }}" @@ -64,7 +64,7 @@ - not containerized_deployment_with_kv - ip_version == 'ipv6' - hostvars[groups[mon_group_name][0]]['monitor_address'] is defined - - hostvars[groups[mon_group_name][0]]['monitor_address'] != '0.0.0.0' + - hostvars[groups[mon_group_name][0]]['monitor_address'] != 'x.x.x.x' - name: ipv6 - force peer addition as potential bootstrap peer for cluster bringup - monitor_address_block command: "{{ docker_exec_cmd }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ monitor_name }}.asok add_bootstrap_peer_hint [{{ hostvars[groups[mon_group_name][0]]['ansible_all_' + ip_version + '_addresses'] | ipaddr(monitor_address_block) | first }}]" diff --git a/roles/ceph-mon/templates/ceph-mon.service.j2 b/roles/ceph-mon/templates/ceph-mon.service.j2 index 922f61677..f0aebf2c0 100644 --- a/roles/ceph-mon/templates/ceph-mon.service.j2 +++ b/roles/ceph-mon/templates/ceph-mon.service.j2 @@ -36,7 +36,7 @@ ExecStart=/usr/bin/docker run --rm --name ceph-mon-%i \ {% elif ip_version == 'ipv6' -%} -e MON_IP=[{{ hostvars[inventory_hostname]['ansible_all_' + ip_version + '_addresses'] | ipaddr(monitor_address_block) | last }}] \ {% endif -%} -{% elif hostvars[inventory_hostname]['monitor_address'] is defined and hostvars[inventory_hostname]['monitor_address'] != '0.0.0.0' %} +{% elif hostvars[inventory_hostname]['monitor_address'] is defined and hostvars[inventory_hostname]['monitor_address'] != 'x.x.x.x' %} {% if ip_version == 'ipv4' -%} -e MON_IP={{ hostvars[inventory_hostname]['monitor_address'] }} \ {% elif ip_version == 'ipv6' -%} diff --git a/roles/ceph-validate/tasks/main.yml b/roles/ceph-validate/tasks/main.yml index 0bf0dfe6d..b9c8434d1 100644 --- a/roles/ceph-validate/tasks/main.yml +++ b/roles/ceph-validate/tasks/main.yml @@ -40,7 +40,7 @@ msg: "Either monitor_address, monitor_address_block or monitor_interface must be provided" when: - mon_group_name in group_names - - monitor_address == '0.0.0.0' + - monitor_address == 'x.x.x.x' - monitor_address_block == 'subnet' - monitor_interface == 'interface' @@ -49,7 +49,7 @@ msg: "Either radosgw_address, radosgw_address_block or radosgw_interface must be provided" when: - rgw_group_name in group_names - - radosgw_address == '0.0.0.0' + - radosgw_address == 'x.x.x.x' - radosgw_address_block == 'subnet' - radosgw_interface == 'interface' @@ -172,7 +172,7 @@ when: - mon_group_name in group_names - monitor_interface != "dummy" - - monitor_address == "0.0.0.0" + - monitor_address == "x.x.x.x" - monitor_address_block == "subnet" - name: include check_ipaddr_mon.yml @@ -180,7 +180,7 @@ when: - mon_group_name in group_names - monitor_interface == "interface" - - monitor_address == "0.0.0.0" + - monitor_address == "x.x.x.x" - monitor_address_block != "subnet" - name: include check_eth_rgw.yml @@ -188,7 +188,7 @@ when: - rgw_group_name in group_names - radosgw_interface != "dummy" - - radosgw_address == "0.0.0.0" + - radosgw_address == "x.x.x.x" - radosgw_address_block == "subnet" - name: include check_rgw_multisite.yml