From 675087d01c3455f65a0df587cf5f5efba18527ff Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Wed, 21 Jun 2017 15:55:41 +0200 Subject: [PATCH] Doc: Add a note to clarify how to setup network Explain how to setup networking in ceph-ansible by adding a note in README.md. Signed-off-by: Guillaume Abrioux --- README.md | 8 ++++++++ group_vars/all.yml.sample | 6 +++--- roles/ceph-common/defaults/main.yml | 7 ++++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ee526734c..8eac87100 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,14 @@ incorrect configuration options appearing in ceph.conf. * We will no longer accept pull requests that modify the ceph.conf template unless it helps the deployment. For simple configuration tweaks please use the `ceph_conf_overrides` variable. +### Networking + +In any case, you must define `monitor_interface` variable with the network interface name which will carry the IP address in the `public_network` subnet. +`monitor_interface` must be defined at least in `group_vars/all.yml` but it can be overrided in inventory host file if needed. +You can specify for each monitor on which IP address it will bind to by specifying the `monitor_address` variable in the **inventory host file**. +You can also use the `monitor_address_block` feature, just specify a subnet, ceph-ansible will automatically set the correct addresses in ceph.conf +Preference will go to `monitor_address_block` if specified, then `monitor_address`, otherwise it will take the first IP address found on the network interface specified in `monitor_interface` by default. + ## Special notes If you are looking at deploying a Ceph version older than Jewel. diff --git a/group_vars/all.yml.sample b/group_vars/all.yml.sample index 78be891fb..e7822d167 100644 --- a/group_vars/all.yml.sample +++ b/group_vars/all.yml.sample @@ -247,15 +247,15 @@ dummy: ## Monitor options # -# You must define either monitor_interface or monitor_address. Preference -# will go to monitor_interface if both are defined. +# You must define monitor_interface. +# You can also specify for each monitor which address the monitor will bind to in your **inventory host file** by using 'monitor_address' variable. +# Preference will go to monitor_address if both are defined. # To use an IPv6 address, use the monitor_address setting instead (and set ip_version to ipv6) #monitor_interface: interface #monitor_address: 0.0.0.0 # set to either ipv4 or ipv6, whichever your network is using #ip_version: ipv4 #mon_use_fqdn: false # if set to true, the MON name used will be the fqdn in the ceph.conf -#monitor_address_block: false ## OSD options # diff --git a/roles/ceph-common/defaults/main.yml b/roles/ceph-common/defaults/main.yml index 699aa8b27..f12ab632b 100644 --- a/roles/ceph-common/defaults/main.yml +++ b/roles/ceph-common/defaults/main.yml @@ -239,15 +239,16 @@ rbd_client_admin_socket_path: /var/run/ceph # must be writable by QEMU and allow ## Monitor options # -# You must define either monitor_interface or monitor_address. Preference -# will go to monitor_interface if both are defined. +# You must define either monitor_interface, monitor_address or monitor_address_block. +# These variables must be defined at least in all.yml and overrided if needed (inventory host file or group_vars/*.yml). +# 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. # To use an IPv6 address, use the monitor_address setting instead (and set ip_version to ipv6) monitor_interface: interface monitor_address: 0.0.0.0 # set to either ipv4 or ipv6, whichever your network is using ip_version: ipv4 mon_use_fqdn: false # if set to true, the MON name used will be the fqdn in the ceph.conf -monitor_address_block: false ## OSD options # -- 2.39.5