From fc34fb1bd955f228b55d360c179c7e162f766a21 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Wed, 9 Jan 2019 13:23:07 +0100 Subject: [PATCH] mon: ability to change mon listening port on container MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit You can now use 'ceph_mon_container_listen_port' to change the port the monitor will listen on. Setting the default to 3300 (assigned by IANA) since Nautilus has released the messenger2 transport protocol. Signed-off-by: Sébastien Han --- group_vars/mons.yml.sample | 1 + roles/ceph-mon/defaults/main.yml | 1 + roles/ceph-mon/templates/ceph-mon.service.j2 | 1 + 3 files changed, 3 insertions(+) diff --git a/group_vars/mons.yml.sample b/group_vars/mons.yml.sample index b6d49a405..89f75fe1b 100644 --- a/group_vars/mons.yml.sample +++ b/group_vars/mons.yml.sample @@ -74,6 +74,7 @@ dummy: # These options can be passed using the 'ceph_mon_docker_extra_env' variable. #ceph_mon_docker_memory_limit: "{{ ansible_memtotal_mb }}m" #ceph_mon_docker_cpu_limit: 1 +#ceph_mon_container_listen_port: 3300 # Use this variable to add extra env configuration to run your mon container. # If you want to set a custom admin keyring you can set this variable like following: diff --git a/roles/ceph-mon/defaults/main.yml b/roles/ceph-mon/defaults/main.yml index 29dcafaff..47f7d7104 100644 --- a/roles/ceph-mon/defaults/main.yml +++ b/roles/ceph-mon/defaults/main.yml @@ -66,6 +66,7 @@ create_crush_tree: false # These options can be passed using the 'ceph_mon_docker_extra_env' variable. ceph_mon_docker_memory_limit: "{{ ansible_memtotal_mb }}m" ceph_mon_docker_cpu_limit: 1 +ceph_mon_container_listen_port: 3300 # Use this variable to add extra env configuration to run your mon container. # If you want to set a custom admin keyring you can set this variable like following: diff --git a/roles/ceph-mon/templates/ceph-mon.service.j2 b/roles/ceph-mon/templates/ceph-mon.service.j2 index 92e4e55cc..79718a15f 100644 --- a/roles/ceph-mon/templates/ceph-mon.service.j2 +++ b/roles/ceph-mon/templates/ceph-mon.service.j2 @@ -27,6 +27,7 @@ ExecStart=/usr/bin/{{ container_binary }} run --rm --name ceph-mon-%i \ -e MON_IP={{ _current_monitor_address }} \ -e CLUSTER={{ cluster }} \ -e FSID={{ fsid }} \ + -e MON_PORT={{ ceph_mon_container_listen_port }} \ -e CEPH_PUBLIC_NETWORK={{ public_network | regex_replace(' ', '') }} \ -e CEPH_DAEMON=MON \ {{ ceph_mon_docker_extra_env }} \ -- 2.39.5