Offline installation Foreman 1.24 Centos7

Hello everyone,

I want to install Foreman in my Centos7. I don’t have access to the Internet so I downloaded all the rpm packages :

  • foreman-installer-1.2.4.0-0.6.RC2.el7.noarch.rpm
  • foreman-release-1.2.4.0-0.3.RC2.el7.noarch.rpm
  • puppetlabs-release-pc1-el-7.noarch.rpm
  • puppet-agent-6.10.1-1.el7.x86_64.rpm
  • epel-release-latest-7.noarch
  • and a lot of rpm ruby

I edited a hostname : “foremanserver”
hostname -f :“foremanserver.localdomain”

/etc/hosts : “127.0.0.1 foremanserver.localdomain foremanserver”

I enabled some port with “firewall-cmd” command

When I run “foreman-installer”, it said

I have some /opt/puppetlabs/puppet/lib/ruby/2.5.0/benchmark […] error message

Cannot find a valid baseurl for repo : base/7/x86_64
Could not find a suitable provider for foreman_config_entry
Could not find a suitable provider for foreman_smartproxy

Preparation installation done
Something went wrong!

.

The foreman installer assumes network connectivity to all the repositories it relies on - namely, Centos, EPEL, SCL (for rh-ruby25), puppetlabs and of course Foreman.
You will likely need to create a local offline mirror of all of them for the installer to finish properly, or try running an install in a connected environment to see the full list of installed packages that you need to get into the disconnected environment.

Hello,

Thank you for your reply.

Could you please tell me all the steps to create a local offline mirror of all the Foreman installation?

Because I downloaded one by one all the rpm packets as I told you, so I need more packet?

Something like:

rsync -rlvSH --delete --exclude nightly --exclude scratch rsync://rsync.theforeman.org/yum/releases/1.24/el7/x86_64/ .

@infra I wonder if we should advertise this in the welcome page of yum/download sites so people do not use wget/curl mirroring which is less effective

I am not sure we should teach users how to use their systems.

Also reposync exists, which is even better than rsync :smiley:

But I would merge a patch if you do the documentation effort :wink:

That would only download the foreman repo, the installer relies on packages that are in EL base, EPEL, puppetlabs and scl repos.
I’m afraid explaining how to create local repos on a disconnected network is a bit out of the scope of this support forum.

Agreed.

Actually I’ve just found we already have it there :slight_smile:

Accessing this repo
This repository is available over HTTP, HTTPS and rsync:

    http://yum.theforeman.org
    https://yum.theforeman.org
    rsync://rsync.theforeman.org/yum

Which is actually not correct, the repo is not available via HTTP anymore.

I already downloaded all the rpm packets needed, without all of theses, I could not run the “foreman-installer” command.

I think he is trying to access on a repo, but without connection, he cannot. So I had disable all the repo, but it didn’t work.

@ekohl is it possible to override the repository file in puppet? I think the user struggle with Puppet overrwriting repo file everytime enforcing our official URL while he/she needs some local mirror or directory.

I cannot run your command because :
rsync.theforeman.org 873: Name or service not known”
“rsync error: error in socket I0 (code 10) at clientserver.c(125) [Receiver=3.1.2]”

I installed Foreman 1.24 in a connected environment, and it successful installed.

But now I have to install it in the non connected environment. Do I really have to be connected when I run the “Foreman-installer” command ? What does the script do ?

I have just synced from our rsync site the data. It works here, check your connection, DNS, firewalls.

Foreman-installer calls Puppet which does a ton of things. One of these is calling multiple “yum install” commands from CentOS, EPEL and Foreman repositories.

If you make sure these repositories are available locally, you can install Foreman offline.

The installer doesn’t manage the repositories (by default) so this shouldn’t be an issue.

Overall I’d say offline install works, but we do require some knowledge from the admin. The only thing we rely on during installation is yum repositories. That means you can use reposync (part of yum-utils) and set up your repositories. This is nothing Foreman specific so we never documented this. Some users are using a Pulp instance as well but it’s good to note Katello doesn’t support self-hosting.

I ran your command in my non connected environment.

How can I know which “yum install” is he trying to do ?

I only installed all rpm packets needed to run the foreman-installer, I didn’t create a local repository for this, change the path etc.

This ^^.

I think I had all, but maybe he is trying to install something else that he can’t, but I don’t know which one is it.

You need to ensure yum install works. We only support having the entire repositories available, not just single RPMs. It’s up to you to fix this. The easiest solution was reposync and configure yum to point to it.

2 Likes

If you run the installer with -v you will see which yum commands it calls. Also there is a file in /var/log/foreman-installer directory for each run.

Thank you everyone. Indeed, I didn’t install “all” the RPM packet. I missed the"tfm" and “rh-ruby25”, etc.
Then I run the foreman-installer -v to check what the script tried to install. But you can also skip this with the interractive mode and disable what you want (for example puppet-server).