Bug 790301 - Binding to a repo gives the wrong hostname in the yum repo file
Summary: Binding to a repo gives the wrong hostname in the yum repo file
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Pulp
Classification: Retired
Component: user-experience
Version: 1.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Jay Dobies
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-14 07:14 UTC by Jason Connor
Modified: 2014-03-31 01:39 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-14 22:00:44 UTC


Attachments (Terms of Use)

Description Jason Connor 2012-02-14 07:14:05 UTC
Description of problem:
Bound to a repo that has the ip address in the repo url. Ended up with 'localhost' as the host name in the yum repo file.

Steps to Reproduce:
1. Register consumer against server with a 'server name' of an ip address
2. Bind consumer to a repo listed on that server
3. Unable to install packages from repo because 'localhost' is server name in yum repo file
  
Actual results:
[root@consumer-1 jconnor]# pulp-consumer consumer bind --repoid 0ad
Successfully subscribed consumer [consumer-1] to repo [0ad]

[root@consumer-1 jconnor]# pulp-consumer repo list
+------------------------------------------+
       List of Available Repositories
+------------------------------------------+

Id                 	0ad                      
Name               	0ad                      
Repo URL           	https://10.0.1.189/pulp/repos/repos/bioinfornatics/0ad/fedora-16/x86_64/
...

[root@consumer-1 jconnor]# cat /etc/yum.repos.d/pulp.repo 
#
# Pulp Repositories
# Managed by Pulp client
#

[0ad]
name = 0ad
enabled = 1
sslverify = 0
gpgcheck = 0
baseurl = https://localhost/pulp/repos/repos/bioinfornatics/0ad/fedora-16/x86_64


Expected results:
Expected ip address instead of 'localhost' in the yum repo file

Comment 1 Jay Dobies 2012-02-14 16:27:04 UTC
I think this is due to the server name not being set (or picked up) in pulp/pulp.conf. Note to self: make sure that step is mentioned in the user guide.

Comment 2 Jay Dobies 2012-02-14 22:00:44 UTC
I double checked this on the v1 candidate and can't reproduce. I suspect it's that server_name wasn't set correctly or the server hadn't been bounced after it was.

As a further sanity check, I looked in the code to where the bind data is built. In the snippet below, hostnames was already populated from the CDS distribution algorithm:

    # Add in the pulp server itself as the last host in the list if there are CDS
    # instances; if there are none, the pulp server will be the only entry (default case)
    server_name = pulp.server.config.config.get('server', 'server_name')
    hostnames.append(server_name)

I'll update the install guide to remind people to set this; it's an important step that's unlisted.

Comment 3 Jay Dobies 2012-02-14 22:02:35 UTC
Actually, it's already in the installation instructions to be done before starting the server the first time:

3. Update '/etc/pulp/pulp.conf' to reflect the hostname of the Pulp server.

    Change 'localhost' in the below to the hostname of the Pulp server.


Note You need to log in before you can comment on or make changes to this bug.