api
api copied to clipboard
Sample SSL configuration redirects to ip address
Description
Suggested SSL configuration based on example /etc/httpd/conf.d/tendrl-ssl.conf.sample
as described in https://github.com/Tendrl/api/pull/264 redirects http requests to https using ip address.
Based on @dahorak 's feedback: https://github.com/Tendrl/tendrl-ansible/pull/46#discussion_r140742360 and today's A daily meeting of Tendrl developers.
Version
Recent snapshot build from master branch:
tendrl-api-httpd-1.5.2-20170921T125939.61d8945.noarch
Steps to Reproduce
- Prepare machines with GlusterFS cluster, including gluster volume (I used nightly builds and volume_usmqe_alpha_distrep_4x2.create.conf)
- Install Tendrl via tendrl-ansible there, using snapshot builds and https://github.com/Tendrl/tendrl-ansible/pull/46/commits/57a4cfd1b4db3d4b4bc0eeb8329f021e90d4f342 from work in progress branch for https://github.com/Tendrl/tendrl-ansible/pull/46
- Log into the Tendrl web interface as an admin user, using full hostname and plain http in url
- See the redirection
Actual Results
The user is redirected to ip address of the server: eg. from http://mbukatov-usm1-server.example.com/
it redirects to https://10.34.108.90/
:
Expected Results
The redirection uses full hostname (fqdn).
@r0h4n @brainfunked @dahorak so far this seems to me to be a minor configuration change (affecting the default config sample and tendrl-ansible), what do you think?
I have tried to reconfigure the redirection using fqdn:
$ git diff roles/tendrl-server/tasks/httpd-ssl.yml
diff --git a/roles/tendrl-server/tasks/httpd-ssl.yml b/roles/tendrl-server/tasks/httpd-ssl.yml
index 829f48a..a33730f 100644
--- a/roles/tendrl-server/tasks/httpd-ssl.yml
+++ b/roles/tendrl-server/tasks/httpd-ssl.yml
@@ -85,7 +85,7 @@
lineinfile:
path: /etc/httpd/conf.d/tendrl.conf
regexp: ' *#? *Redirect permanent / https://.*/'
- line: " Redirect permanent / https://{{ httpd_ip_address }}/"
+ line: " Redirect permanent / https://{{ ansible_fqdn }}/"
notify:
- restart httpd
and at first sight, it seems to work fine for me:
@mbukatov your solution is good, please use it.
@brainfunked ack
Fix is part of https://github.com/Tendrl/tendrl-ansible/pull/46
@mbukatov Is this still relevant or can we close this?