Bug 1043394

Summary: listener.rb fixes
Product: OpenShift Container Platform Reporter: Brenton Leanhardt <bleanhar>
Component: DocumentationAssignee: brice <bfallonf>
Status: CLOSED CURRENTRELEASE QA Contact: ecs-bugs
Severity: medium Docs Contact:
Priority: unspecified    
Version: 2.0.0CC: adellape, alyoung, bleanhar, jokerman, libra-onpremise-devel, lmeyer, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-06 05:08:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Brenton Leanhardt 2013-12-16 08:21:45 UTC
Description of problem:

In listener.rb the following changes are needed.

--- listener.rb.orig    2013-12-16 08:19:53.182002289 -0500
+++ listener.rb 2013-12-16 01:40:21.095994919 -0500
   scope = "#{appname}-#{namespace}"
   file = File.join(CONF_DIR, "#{scope}.conf")
   if File.exist?(file)
-    `sed -i 's/upstream #{scope} {/&\n      server #{ip}:#{port}' #{file}`
+    `sed -i 's/upstream #{scope} {/&\\n      server #{ip}:#{port};/' #{file}` 
   else
     # write a new one
-    template = >>-EOF
+    template = <<-EOF
     upstream #{scope} {
       server #{ip}:#{port};
     }

Comment 2 Luke Meyer 2013-12-16 15:45:34 UTC
Context is "5.8.5.1.2. Routing Listener" under "5.8.5. External Load Balancing" http://documentation-devel.engineering.redhat.com/docs/en-US/OpenShift_Enterprise/2/html-single/Deployment_Guide/index.html#sect-External_Load_Balancing

Comment 6 Luke Meyer 2013-12-17 18:12:41 UTC
I copied the source here:

https://github.com/openshift/openshift-extras/blob/master/admin/sample_routing_listener.rb
https://github.com/openshift/openshift-extras/blob/enterprise-2.0/admin/sample_routing_listener.rb

... and applied changes. May want to point to the enterprise-2.0 version in the docs; possibly for future versions it will need non-compatible updates.

Comment 7 brice 2013-12-18 02:16:37 UTC
I believe I have made the appropriate changes. At least I hope... I went by the info in the initial comment, but it may not be exactly what you've asked for.

Let me know if any other changes need to be made.

Comment 9 Brenton Leanhardt 2013-12-18 03:14:19 UTC
(In reply to brice from comment #7)
> I believe I have made the appropriate changes. At least I hope... I went by
> the info in the initial comment, but it may not be exactly what you've asked
> for.
> 
> Let me know if any other changes need to be made.

I think the sed line is still wrong.  It needs to be:

`sed -i 's/upstream #{scope} {/&\\n      server #{ip}:#{port};/' #{file}`

I see part of it was updated but it is missing the ;/

Comment 10 brice 2013-12-18 03:19:09 UTC
You are correct. It should be alright now.

Comment 11 Brenton Leanhardt 2013-12-18 03:31:44 UTC
This line should not be there:

listener.rb 2013-12-16 01:40:21.095994919 -0500

That was the diff output.

Comment 12 Brenton Leanhardt 2013-12-18 03:35:43 UTC
Actually, while we're making changes.  Please fetch the latest from https://raw.github.com/openshift/openshift-extras/enterprise-2.0/admin/sample_routing_listener.rb

That files includes important comments the will prove helpful for the admin.

Comment 13 brice 2013-12-18 04:44:48 UTC
Line has been removed and I've talked to Brenton. Topic should be good now. Topic matches quite well with the github doc too.

Putting to QA.