]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Common: changed civetweb line in rgw section(conf) 1731/head
authorSirishaGuduru <SGuduru@walmartlabs.com>
Mon, 7 Aug 2017 09:23:32 +0000 (14:53 +0530)
committerSirishaGuduru <SGuduru@walmartlabs.com>
Wed, 23 Aug 2017 09:33:37 +0000 (15:03 +0530)
Resolves issue: Multiple RGW Ceph.conf Issue #1258

In multi-RGW setup, in ceph.conf the RGW sections
contain identical bind IP in civetweb line. So this
modification fixes that issue and puts the right IP
for each RGW.

Signed-off-by: SirishaGuduru SGuduru@walmartlabs.com
Modified ceph-defaults and ran generate_group_vars_sample.sh

group_vars/osds.yml.sample and group_vars/rhcs.yml.sample are
not part of the changes. But they got modified when
generate_group_vars_sample.sh is ran to generate group_vars/
all.yml.sample.

Uncommented added variables in ceph-defaults

Updated tests by adding value for radosgw_interface

Added radosgw_interface to centos cluster tests

Modified ceph-rgw role,rebased and ran generate_group_vars_sample.sh

In ceph-rgw role removed check_mandatory_vars.yml.
Rebased on master.
Ran generate_group_vars_sample.sh and then the below files got
modified.

27 files changed:
Vagrantfile
group_vars/all.yml.sample
group_vars/mdss.yml.sample
group_vars/mgrs.yml.sample
group_vars/mons.yml.sample
group_vars/osds.yml.sample
group_vars/rgws.yml.sample
group_vars/rhcs.yml.sample
roles/ceph-common/tasks/checks/check_mandatory_vars.yml
roles/ceph-common/templates/ceph.conf.j2
roles/ceph-defaults/defaults/main.yml
tests/functional/centos/7/bluestore/group_vars/all
tests/functional/centos/7/bs-crypt-ded-jrn/group_vars/all
tests/functional/centos/7/bs-crypt-jrn-col/group_vars/all
tests/functional/centos/7/bs-dock-crypt-jrn-col/group_vars/all
tests/functional/centos/7/bs-dock-ded-jrn/group_vars/all
tests/functional/centos/7/bs-docker/group_vars/all
tests/functional/centos/7/bs-jrn-col/group_vars/all
tests/functional/centos/7/cluster/group_vars/all
tests/functional/centos/7/crypt-ded-jrn/group_vars/all
tests/functional/centos/7/crypt-jrn-col/group_vars/all
tests/functional/centos/7/docker-crypt-jrn-col/group_vars/all
tests/functional/centos/7/docker-ded-jrn/group_vars/all
tests/functional/centos/7/docker/group_vars/all
tests/functional/centos/7/jrn-col/group_vars/all
tests/functional/centos/7/lvm-osds/group_vars/all
tests/functional/ubuntu/16.04/cluster/group_vars/all

index 5fb08b5b018dad6c3468582f3dd4ec25793df9ac..cc45504c31c8ef400518b3ba5b70e7718be47274 100644 (file)
@@ -81,6 +81,7 @@ ansible_provision = proc do |ansible|
       devices: settings['disks'],
       ceph_docker_on_openstack: BOX == 'openstack',
       ceph_rgw_civetweb_port: 8080,
+      radosgw_interface: ETH,
       generate_fsid: 'true',
     })
   else
@@ -88,6 +89,7 @@ ansible_provision = proc do |ansible|
       devices: settings['disks'],
       osd_scenario: 'collocated',
       monitor_interface: ETH,
+      radosgw_interface: ETH,
       os_tuning_params: settings['os_tuning_params'],
       pool_default_size: '2',
     })
@@ -97,11 +99,14 @@ ansible_provision = proc do |ansible|
     ansible.sudo = true
     # Use monitor_address_block instead of monitor_interface:
     ansible.extra_vars.delete(:monitor_interface)
+    # Use radosgw_address_block instead of radosgw_interface:
+    ansible.extra_vars.delete(:radosgw_interface)
     ansible.extra_vars = ansible.extra_vars.merge({
       cluster_network: "#{CLUSTER_SUBNET}.0/16",
       devices: ['/dev/sdc'], # hardcode leftover disk
       osd_scenario: 'collocated',
       monitor_address_block: "#{PUBLIC_SUBNET}.0/16",
+      radosgw_address_block: "#{PUBLIC_SUBNET}.0/16",
       public_network: "#{PUBLIC_SUBNET}.0/16",
     })
   end
index 41c6779017b0ecd56fdcb1c9f4fd87dfbd0cec17..a0c3749d0d4b81c150ad37ab5cc28e0ee7dd071d 100644 (file)
@@ -302,7 +302,15 @@ dummy:
 # For additional civetweb configuration options available such as SSL, logging,
 # keepalive, and timeout settings, please see the civetweb docs at
 # https://github.com/civetweb/civetweb/blob/master/docs/UserManual.md
-#radosgw_civetweb_options: "port={{ radosgw_civetweb_bind_ip }}:{{ radosgw_civetweb_port }} num_threads={{ radosgw_civetweb_num_threads }}"
+#radosgw_civetweb_options: "num_threads={{ radosgw_civetweb_num_threads }}"
+# You must define either radosgw_interface, radosgw_address.
+# 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 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.
+# To use an IPv6 address, use the radosgw_address setting instead (and set ip_version to ipv6)
+#radosgw_interface: interface
+#radosgw_address: 0.0.0.0
+#radosgw_address_block: []
 #radosgw_keystone: false # activate OpenStack Keystone options full detail here: http://ceph.com/docs/master/radosgw/keystone/
 # Rados Gateway options
 #email_address: foo@bar.com
index f14cda8d50c13c79fa2f9aa812a2220d8619ca5a..aced2742d1cb116b63f6dbbaef1698fb3dcc1729 100644 (file)
@@ -28,6 +28,7 @@ dummy:
 #ceph_mds_docker_extra_env: -e CLUSTER={{ cluster }} -e MDS_NAME={{ ansible_hostname }}
 #ceph_config_keys: [] # DON'T TOUCH ME
 
+
 ###########
 # SYSTEMD #
 ###########
index 4c89e83230a41fe7aa85d68de8c269e0003ccfd9..0422383dc36eb2e46515436817ef8186c3cff0f9 100644 (file)
@@ -14,6 +14,7 @@ dummy:
 #ceph_mgr_docker_extra_env: -e CLUSTER={{ cluster }} -e MGR_NAME={{ ansible_hostname }}
 #ceph_config_keys: [] # DON'T TOUCH ME
 
+
 ###########
 # SYSTEMD #
 ###########
index 236739de6e61b4c1bf4f03b4e9bb7c0bb01c9791..7afc6417d08fdfe360c640fc169f17f9ff2e7844 100644 (file)
@@ -125,6 +125,7 @@ dummy:
 #mon_docker_net_host: true
 #ceph_config_keys: [] # DON'T TOUCH ME
 
+
 ###########
 # SYSTEMD #
 ###########
index 5602d9af271e39f5de4a08ad3a8621a424e60742..168a25d3f6353ac54feafb859bcda21877ba3e8d 100644 (file)
@@ -247,6 +247,7 @@ dummy:
 #ceph_osd_docker_extra_env: -e CLUSTER={{ cluster }} -e OSD_JOURNAL_SIZE={{ journal_size }}
 #ceph_osd_docker_run_script_path: "/usr/share" # script called by systemd to run the docker command
 
+
 ###########
 # SYSTEMD #
 ###########
index 53ea5976eae182714b3828925f4ab38b6b71d16f..5b274f2d7bbea695ca077e9b2939a9c8f59b1b6c 100644 (file)
@@ -60,6 +60,7 @@ dummy:
 #ceph_config_keys: [] # DON'T TOUCH ME
 #rgw_config_keys: "/" # DON'T TOUCH ME
 
+
 ###########
 # SYSTEMD #
 ###########
index 558f84b7d23f564ac12779b9a50272b8f64561db..a0c3749d0d4b81c150ad37ab5cc28e0ee7dd071d 100644 (file)
@@ -13,7 +13,7 @@ dummy:
 # GENERAL #
 ###########
 
-fetch_directory: ~/ceph-ansible-keys
+#fetch_directory: fetch/
 
 # The 'cluster' variable determines the name of the cluster.
 # Changing the default value to something else means that you will
@@ -154,7 +154,7 @@ fetch_directory: ~/ceph-ansible-keys
 # Commit 492518a2 changed variable names of rhcs installations
 # to not break backward compatiblity we re-declare these variables
 # with the content of the new variable
-ceph_rhcs: true
+#ceph_rhcs: "{{ ceph_stable_rh_storage | default(false) }}"
 # This will affect how/what repositories are enabled depending on the desired
 # version. The previous version was 1.3. The current version is 2.
 #ceph_rhcs_version: "{{ ceph_stable_rh_storage_version | default(2) }}"
@@ -302,7 +302,15 @@ ceph_rhcs: true
 # For additional civetweb configuration options available such as SSL, logging,
 # keepalive, and timeout settings, please see the civetweb docs at
 # https://github.com/civetweb/civetweb/blob/master/docs/UserManual.md
-#radosgw_civetweb_options: "port={{ radosgw_civetweb_bind_ip }}:{{ radosgw_civetweb_port }} num_threads={{ radosgw_civetweb_num_threads }}"
+#radosgw_civetweb_options: "num_threads={{ radosgw_civetweb_num_threads }}"
+# You must define either radosgw_interface, radosgw_address.
+# 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 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.
+# To use an IPv6 address, use the radosgw_address setting instead (and set ip_version to ipv6)
+#radosgw_interface: interface
+#radosgw_address: 0.0.0.0
+#radosgw_address_block: []
 #radosgw_keystone: false # activate OpenStack Keystone options full detail here: http://ceph.com/docs/master/radosgw/keystone/
 # Rados Gateway options
 #email_address: foo@bar.com
index 4c7d20616d56cc9f77505d41978149ae5cef8822..4b59a67bda47472bd2563ead83ff6e0f8911a41b 100644 (file)
     - monitor_interface == 'interface'
     - monitor_address == "0.0.0.0"
     - mon_group_name in group_names
+
+- name: make sure radosgw_interface or radosgw_address is defined
+  fail:
+    msg: "you must set radosgw_interface or radosgw_address"
+  when:
+    - radosgw_interface == 'interface'
+    - radosgw_address == "0.0.0.0"
+    - rgw_group_name in group_names
index 6fdbfd4ed264349016d823e3bf6669faf6400e77..16357a1da40067ff5f32028c0bafd30a41910937 100644 (file)
@@ -135,7 +135,26 @@ keyring = /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ hostvars[host]['ansible_hos
 rgw socket path = /tmp/radosgw-{{ hostvars[host]['ansible_hostname'] }}.sock
 log file = /var/log/ceph/{{ cluster }}-rgw-{{ hostvars[host]['ansible_hostname'] }}.log
 rgw data = /var/lib/ceph/radosgw/{{ cluster }}-rgw.{{ hostvars[host]['ansible_hostname'] }}
-rgw frontends = civetweb port={{ radosgw_civetweb_bind_ip }}:{{ radosgw_civetweb_port }} num_threads={{ radosgw_civetweb_num_threads }}
+{% if radosgw_address_block | length > 0 %}
+    {% if ip_version == 'ipv4' -%}
+      rgw frontends = civetweb port={{ hostvars[host]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
+    {%- elif ip_version == 'ipv6' -%}
+      rgw frontends = civetweb port=[{{ hostvars[host]['ansible_all_' + ip_version + '_addresses'] | ipaddr(radosgw_address_block) | first }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
+    {%- endif %}
+{% elif hostvars[host]['radosgw_address'] is defined and hostvars[host]['radosgw_address'] != '0.0.0.0' -%}
+    {% if ip_version == 'ipv4' -%}
+      rgw frontends = civetweb port={{ hostvars[host]['radosgw_address'] }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
+    {%- elif ip_version == 'ipv6' -%}
+      rgw frontends = civetweb port=[{{ hostvars[host]['radosgw_address'] }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
+    {% endif %}
+{%- else -%}
+    {% set interface = ["ansible_",radosgw_interface]|join %}
+    {% if ip_version == 'ipv6' -%}
+      rgw frontends = civetweb port=[{{ hostvars[host][interface][ip_version][0]['address'] }}]:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
+    {%- elif ip_version == 'ipv4' -%}
+      rgw frontends = civetweb port={{ hostvars[host][interface][ip_version]['address'] }}:{{ radosgw_civetweb_port }} {{ radosgw_civetweb_options }}
+    {% endif %}
+{%- endif %}
 {% endif %}
 {% endfor %}
 {% endif %}
index 3d0a055970c16637633212223b68d4bc0438646b..9cb47f8b9b71ad24e87cbbb23f07d66809d15819 100644 (file)
@@ -294,7 +294,15 @@ radosgw_civetweb_num_threads: 100
 # For additional civetweb configuration options available such as SSL, logging,
 # keepalive, and timeout settings, please see the civetweb docs at
 # https://github.com/civetweb/civetweb/blob/master/docs/UserManual.md
-radosgw_civetweb_options: "port={{ radosgw_civetweb_bind_ip }}:{{ radosgw_civetweb_port }} num_threads={{ radosgw_civetweb_num_threads }}"
+radosgw_civetweb_options: "num_threads={{ radosgw_civetweb_num_threads }}"
+# You must define either radosgw_interface, radosgw_address.
+# 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 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.
+# To use an IPv6 address, use the radosgw_address setting instead (and set ip_version to ipv6)
+radosgw_interface: interface
+radosgw_address: 0.0.0.0
+radosgw_address_block: []
 radosgw_keystone: false # activate OpenStack Keystone options full detail here: http://ceph.com/docs/master/radosgw/keystone/
 # Rados Gateway options
 email_address: foo@bar.com
index 716fd81219a1c5e04e291875016ba56349704c2c..f35ee302f0f3b2c852003d24009c3f6c03ffe8a2 100644 (file)
@@ -3,6 +3,7 @@
 ceph_stable: True
 cluster: test
 monitor_interface: eth1
+radosgw_interface: eth1
 public_network: "192.168.1.0/24"
 cluster_network: "192.168.2.0/24"
 journal_size: 100
index 06714631888442b0ac212aabf992483281b48bd1..2a3d1480375927bb8521c966602eb2740059eb45 100644 (file)
@@ -5,6 +5,7 @@ public_network: "192.168.11.0/24"
 cluster_network: "192.168.12.0/24"
 journal_size: 100
 monitor_interface: eth1
+radosgw_interface: eth1
 osd_scenario: non-collocated
 dmcrypt: true
 osd_objectstore: "bluestore"
index 53e2c2194be7b9027e791fabb53dfd698f7011e1..6b701dc86d1b9dac8042b1cc6c032b139d46ff9d 100644 (file)
@@ -5,6 +5,7 @@ public_network: "192.168.13.0/24"
 cluster_network: "192.168.14.0/24"
 journal_size: 100
 monitor_interface: eth1
+radosgw_interface: eth1
 osd_scenario: collocated
 dmcrypt: true
 osd_objectstore: "bluestore"
index ffb7de1e2a5c1a680f207445b76c1a7667ce75be..7b96a4f7ed80293c517464d7812e4592c4ecfeb7 100644 (file)
@@ -7,6 +7,7 @@ public_network: "192.168.23.0/24"
 cluster_network: "192.168.24.0/24"
 journal_size: 100
 monitor_interface: eth1
+radosgw_interface: eth1
 osd_scenario: collocated
 dmcrypt: true
 osd_objectstore: "bluestore"
index 3e1ebdc3e22aeaba2aadfaab8dee22bd5391f4ea..44232c7c6d145fc8e052a3581ce0224eef6512b4 100644 (file)
@@ -7,6 +7,7 @@ ceph_stable: True
 containerized_deployment: True
 cluster: test
 monitor_interface: eth1
+radosgw_interface: eth1
 ceph_mon_docker_subnet: "{{ public_network }}"
 journal_size: 100
 ceph_docker_on_openstack: False
index b6f6dfb768636eb467186b131ba08e9f8a92a037..6f34d9eaea68a0e16edde76b4ed540b489f3f512 100644 (file)
@@ -7,6 +7,7 @@ ceph_stable: True
 containerized_deployment: True
 cluster: test
 monitor_interface: eth1
+radosgw_interface: eth1
 ceph_mon_docker_subnet: "{{ public_network }}"
 journal_size: 100
 ceph_docker_on_openstack: False
index d1d299489c2b3c0553526c2fefbd2bc6f87627aa..6d4fc1190488fb1986dff0f6ae51b46a24a36558 100644 (file)
@@ -3,6 +3,7 @@
 ceph_stable: True
 cluster: test
 monitor_interface: eth1
+radosgw_interface: eth1
 public_network: "192.168.3.0/24"
 cluster_network: "192.168.4.0/24"
 journal_size: 100
index 4ffcbb634368be1e51d0fd58ae381266e484e103..e90587a26a29b6013ef65f00c9c0f897217de665 100644 (file)
@@ -5,6 +5,7 @@ cluster: test
 public_network: "192.168.1.0/24"
 cluster_network: "192.168.2.0/24"
 journal_size: 100
+radosgw_interface: eth1
 osd_objectstore: "filestore"
 devices:
   - '/dev/sda'
index 18bd190fdeb326d9f67ec08ad3faab7cf8e4a71b..ef1fa393c890d45b489d5c1e751893d16dea89e4 100644 (file)
@@ -5,6 +5,7 @@ public_network: "192.168.11.0/24"
 cluster_network: "192.168.12.0/24"
 journal_size: 100
 monitor_interface: eth1
+radosgw_interface: eth1
 osd_scenario: non-collocated
 osd_objectstore: "filestore"
 devices:
index b9b8ee38e39aa889d885d1bbce6fa75435783da6..e7c2134defbef7f1a96ad6a875a01c44ea60eb95 100644 (file)
@@ -5,6 +5,7 @@ public_network: "192.168.13.0/24"
 cluster_network: "192.168.14.0/24"
 journal_size: 100
 monitor_interface: eth1
+radosgw_interface: eth1
 osd_scenario: collocated
 osd_objectstore: "filestore"
 devices:
index 962da29a7702e4913951ebf873deb34cfe10406f..b042cb62d597e8247dd843b4bb8d95f77741fd7a 100644 (file)
@@ -7,6 +7,7 @@ ceph_stable: True
 containerized_deployment: True
 cluster: ceph
 monitor_interface: eth1
+radosgw_interface: eth1
 ceph_mon_docker_subnet: "{{ public_network }}"
 journal_size: 100
 ceph_docker_on_openstack: False
index 0d865fefb911384905fbb7f25adc1db00f992540..74c84409f193af424c6c4ac22c160c037df139eb 100644 (file)
@@ -7,6 +7,7 @@ ceph_stable: True
 containerized_deployment: True
 cluster: test
 monitor_interface: eth1
+radosgw_interface: eth1
 ceph_mon_docker_subnet: "{{ public_network }}"
 journal_size: 100
 ceph_docker_on_openstack: False
index 6201198d94f0c593d977a84fa581277d9ff4fd1b..864ec8c9fa764f5bc4b230fcdfe8fc781314141a 100644 (file)
@@ -7,6 +7,7 @@ ceph_stable: True
 containerized_deployment: True
 cluster: test
 monitor_interface: eth1
+radosgw_interface: eth1
 ceph_mon_docker_subnet: "{{ public_network }}"
 journal_size: 100
 ceph_docker_on_openstack: False
index 7219ea2bf8c4fcf487851e326d10b037b528afd6..88d7a335d44cbcd1582ab916730edde988bd9256 100644 (file)
@@ -5,6 +5,7 @@ cluster: test
 public_network: "192.168.3.0/24"
 cluster_network: "192.168.4.0/24"
 monitor_interface: eth1
+radosgw_interface: eth1
 journal_size: 100
 osd_objectstore: "filestore"
 devices:
index 8cb72ac0c86602ca4558acda58a797437cf9bf87..2aff22de4db40bf5fdc1b7f1d052f64724425c71 100644 (file)
@@ -5,6 +5,7 @@ cluster: ceph
 public_network: "192.168.3.0/24"
 cluster_network: "192.168.4.0/24"
 monitor_interface: eth1
+radosgw_interface: eth1
 journal_size: 100
 osd_objectstore: "filestore"
 osd_scenario: lvm
index 8122d46c130b06b16f50a78bc75f03dd4555005d..2fdb5cd327d84102b1f3a9e04b3be0305da1ff56 100644 (file)
@@ -5,6 +5,7 @@ cluster: test
 public_network: "192.168.5.0/24"
 cluster_network: "192.168.6.0/24"
 monitor_interface: eth1
+radosgw_interface: eth1
 journal_size: 100
 devices:
   - '/dev/sdb'