Failed foreman standalone installation

Hello all,

This is my first attempt installing foreman so probably I haven’t understood something.

I’m trying to install foreman as a standalone in its own server (RHEL 8.5) so I can connect it to the other already existing Puppet Open source server that has its own Puppet DB as well.

So, my thought was to have it in a separate server to not mess/damage what I have already setup in case something goes wrong…

I read the following document Foreman :: Manual
and attempted the following:

dnf -y install https://yum.puppet.com/puppet7-release-el-8.noarch.rpm

Enable the Foreman repositories:

dnf -y install https://yum.theforeman.org/releases/3.3/el8/x86_64/foreman-release.rpm

Enable the Foreman module:

dnf module enable foreman:el8

Downloading the installer

yum -y install foreman-installer

After that, I run the below command to just install foreman to connect to the PuppetDB in the other server but without installing puppet server or a proxy locally.
Just to mention that I wasn’t sure if a proxy is needed for the kind of installation I need so I decided not to install it:

foreman-installer
–foreman-db-manage=false
–foreman-db-host=myserver.domain.com
–foreman-db-database=puppetdb
–foreman-db-username=puppetdb
–foreman-db-password=puppetdb
–puppet-server=false
–foreman-proxy-puppet=false
–foreman-proxy-puppetca=false

The installation finished with the following foreman-proxy errors:

foreman-installer --foreman-db-manage=false --foreman-db-host=myserver.domain.com --foreman-db-database=puppetdb --foreman-db-username=puppetdb --foreman-db-password=puppetdb --puppet-server=false --foreman-proxy-puppet=false --foreman-proxy-puppetca=false
2022-09-20 08:34:08 [NOTICE] [root] Loading installer configuration. This will take some time.
2022-09-20 08:34:19 [NOTICE] [root] Running installer with log based terminal output at level NOTICE.
2022-09-20 08:34:19 [NOTICE] [root] Use -l to set the terminal output log level to ERROR, WARN, NOTICE, INFO, or DEBUG. See --full-help for definitions.
2022-09-20 08:34:56 [NOTICE] [configure] Starting system configuration.
2022-09-20 08:38:21 [ERROR ] [configure] Execution of ‘/bin/dnf -d 0 -e 1 -y install foreman-proxy’ returned 1: Error: Error downloading packages:
2022-09-20 08:38:21 [ERROR ] [configure] Cannot download Packages/c/cyrus-sasl-2.1.27-5.el8.x86_64.rpm: All mirrors were tried
2022-09-20 08:38:21 [ERROR ] [configure] /Stage[main]/Foreman_proxy::Install/Package[foreman-proxy]/ensure: change from ‘purged’ to ‘present’ failed: Execution of ‘/bin/dnf -d 0 -e 1 -y install foreman-proxy’ returned 1: Error: Error downloading packages:
2022-09-20 08:38:21 [ERROR ] [configure] Cannot download Packages/c/cyrus-sasl-2.1.27-5.el8.x86_64.rpm: All mirrors were tried
2022-09-20 08:38:26 [NOTICE] [configure] 250 configuration steps out of 909 steps complete.
2022-09-20 08:38:36 [NOTICE] [configure] 500 configuration steps out of 915 steps complete.
2022-09-20 08:38:42 [NOTICE] [configure] 750 configuration steps out of 935 steps complete.
2022-09-20 08:38:49 [NOTICE] [configure] System configuration has finished.

There were errors detected during install.
Please address the errors and re-run the installer to ensure the system is properly configured.
Failing to do so is likely to result in broken functionality.

The full log is at /var/log/foreman-installer/foreman.log

I thought that those errors could be expected so I proceed with the below as per the mentioned doc:

foreman-rake db:migrate

and there the big problems started (sorry for the big output!):

foreman-rake db:migrate
== 20090714132448 CreateHosts: migrating ======================================
– create_table(:hosts, {:id=>:integer})
→ 0.0227s
– add_index(:hosts, :source_file_id)
→ 0.0050s
– add_index(:hosts, :name)
→ 0.0039s
– create_table(:fact_names, {:id=>:integer})
→ 0.0047s
– add_index(:fact_names, :name)
→ 0.0039s
– create_table(:fact_values, {:id=>:integer})
→ 0.0066s
– add_index(:fact_values, :fact_name_id)
→ 0.0045s
– add_index(:fact_values, :host_id)
→ 0.0050s
– add_column(:hosts, :mac, :string, {:limit=>17, :default=>""})
→ 0.0012s
– add_column(:hosts, :sp_mac, :string, {:limit=>17, :default=>""})
→ 0.0008s
– add_column(:hosts, :sp_ip, :string, {:limit=>15, :default=>""})
→ 0.0008s
– add_column(:hosts, :sp_name, :string, {:limit=>255, :default=>""})
→ 0.0007s
– add_column(:hosts, :root_pass, :string, {:limit=>64})
→ 0.0003s
– add_column(:hosts, :serial, :string, {:limit=>12})
→ 0.0003s
– add_column(:hosts, :puppetmaster, :string, {:limit=>255})
→ 0.0004s
– add_column(:hosts, :puppet_status, :integer, {:null=>false, :default=>0})
→ 0.0007s
– add_column(:hosts, :domain_id, :integer, {})
→ 0.0003s
– add_column(:hosts, :architecture_id, :integer, {})
→ 0.0003s
– add_column(:hosts, :operatingsystem_id, :integer, {})
→ 0.0004s
– add_column(:hosts, :subnet_id, :integer, {})
→ 0.0004s
– add_column(:hosts, :sp_subnet_id, :integer, {})
→ 0.0003s
– add_column(:hosts, :ptable_id, :integer, {})
→ 0.0003s
– add_column(:hosts, :medium_id, :integer, {})
→ 0.0003s
– add_column(:hosts, :build, :boolean, {:default=>true})
→ 0.0007s
– add_column(:hosts, :comment, :text, {})
→ 0.0004s
– add_column(:hosts, :disk, :text, {})
→ 0.0004s
– add_column(:hosts, :installed_at, :datetime, {})
→ 0.0005s
== 20090714132448 CreateHosts: migrated (0.0673s) =============================

rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

20090714132448 is out of range for ActiveModel::Type::Integer with limit 4 bytes
/usr/share/gems/gems/activemodel-6.0.4.7/lib/active_model/type/integer.rb:40:in ensure_in_range' /usr/share/gems/gems/activemodel-6.0.4.7/lib/active_model/type/integer.rb:28:in serialize’
/usr/share/gems/gems/activemodel-6.0.4.7/lib/active_model/attribute.rb:55:in value_for_database' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/relation/query_attribute.rb:13:in value_for_database’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/quoting.rb:203:in block in type_casted_binds' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/quoting.rb:203:in map’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/quoting.rb:203:in type_casted_binds' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in exec_no_cache’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/postgresql_adapter.rb:656:in execute_and_clear' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:98:in exec_query’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/database_statements.rb:135:in exec_insert' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:132:in exec_insert’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/database_statements.rb:166:in insert' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/query_cache.rb:22:in insert’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/persistence.rb:375:in _insert_record' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/persistence.rb:932:in _create_record’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/counter_cache.rb:166:in _create_record' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/locking/optimistic.rb:79:in _create_record’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/attribute_methods/dirty.rb:211:in _create_record' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/callbacks.rb:331:in block in _create_record’
/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:101:in run_callbacks' /usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:825:in _run_create_callbacks’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/callbacks.rb:331:in _create_record' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/timestamp.rb:110:in _create_record’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/persistence.rb:905:in create_or_update' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/callbacks.rb:327:in block in create_or_update’
/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:101:in run_callbacks' /usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:825:in _run_save_callbacks’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/callbacks.rb:327:in create_or_update' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/timestamp.rb:128:in create_or_update’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/persistence.rb:503:in save!' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/validations.rb:53:in save!’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/transactions.rb:318:in block in save!' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/transactions.rb:375:in block in with_transaction_returning_status’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/database_statements.rb:278:in transaction' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/transactions.rb:212:in transaction’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/transactions.rb:366:in with_transaction_returning_status' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/transactions.rb:318:in save!’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/suppressor.rb:48:in save!' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/persistence.rb:55:in create!’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1346:in record_version_state_after_migrating' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1311:in block in execute_migration_in_transaction’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1361:in block in ddl_transaction' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in block in transaction’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/transaction.rb:280:in block in within_new_transaction' /usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in block (2 levels) in synchronize’
/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in handle_interrupt' /usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in block in synchronize’
/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in handle_interrupt' /usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in synchronize’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/transaction.rb:278:in within_new_transaction' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in transaction’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/transactions.rb:212:in transaction' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1361:in ddl_transaction’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1309:in execute_migration_in_transaction' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1281:in block in migrate_without_lock’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1280:in each' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1280:in migrate_without_lock’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1229:in block in migrate' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1382:in with_advisory_lock’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1229:in migrate' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1061:in up’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1036:in migrate' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/tasks/database_tasks.rb:238:in migrate’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/railties/databases.rake:86:in block (3 levels) in <top (required)>' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/railties/databases.rake:84:in each’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/railties/databases.rake:84:in block (2 levels) in <top (required)>' /usr/share/gems/gems/rake-13.0.1/exe/rake:27:in <top (required)>’

Caused by:
ActiveModel::RangeError: 20090714132448 is out of range for ActiveModel::Type::Integer with limit 4 bytes
/usr/share/gems/gems/activemodel-6.0.4.7/lib/active_model/type/integer.rb:40:in ensure_in_range' /usr/share/gems/gems/activemodel-6.0.4.7/lib/active_model/type/integer.rb:28:in serialize’
/usr/share/gems/gems/activemodel-6.0.4.7/lib/active_model/attribute.rb:55:in value_for_database' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/relation/query_attribute.rb:13:in value_for_database’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/quoting.rb:203:in block in type_casted_binds' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/quoting.rb:203:in map’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/quoting.rb:203:in type_casted_binds' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/postgresql_adapter.rb:672:in exec_no_cache’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/postgresql_adapter.rb:656:in execute_and_clear' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:98:in exec_query’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/database_statements.rb:135:in exec_insert' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/postgresql/database_statements.rb:132:in exec_insert’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/database_statements.rb:166:in insert' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/query_cache.rb:22:in insert’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/persistence.rb:375:in _insert_record' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/persistence.rb:932:in _create_record’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/counter_cache.rb:166:in _create_record' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/locking/optimistic.rb:79:in _create_record’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/attribute_methods/dirty.rb:211:in _create_record' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/callbacks.rb:331:in block in _create_record’
/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:101:in run_callbacks' /usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:825:in _run_create_callbacks’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/callbacks.rb:331:in _create_record' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/timestamp.rb:110:in _create_record’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/persistence.rb:905:in create_or_update' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/callbacks.rb:327:in block in create_or_update’
/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:101:in run_callbacks' /usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/callbacks.rb:825:in _run_save_callbacks’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/callbacks.rb:327:in create_or_update' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/timestamp.rb:128:in create_or_update’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/persistence.rb:503:in save!' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/validations.rb:53:in save!’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/transactions.rb:318:in block in save!' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/transactions.rb:375:in block in with_transaction_returning_status’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/database_statements.rb:278:in transaction' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/transactions.rb:212:in transaction’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/transactions.rb:366:in with_transaction_returning_status' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/transactions.rb:318:in save!’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/suppressor.rb:48:in save!' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/persistence.rb:55:in create!’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1346:in record_version_state_after_migrating' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1311:in block in execute_migration_in_transaction’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1361:in block in ddl_transaction' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in block in transaction’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/transaction.rb:280:in block in within_new_transaction' /usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in block (2 levels) in synchronize’
/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in handle_interrupt' /usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in block in synchronize’
/usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in handle_interrupt' /usr/share/gems/gems/activesupport-6.0.4.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in synchronize’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/transaction.rb:278:in within_new_transaction' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/connection_adapters/abstract/database_statements.rb:280:in transaction’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/transactions.rb:212:in transaction' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1361:in ddl_transaction’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1309:in execute_migration_in_transaction' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1281:in block in migrate_without_lock’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1280:in each' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1280:in migrate_without_lock’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1229:in block in migrate' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1382:in with_advisory_lock’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1229:in migrate' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1061:in up’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/migration.rb:1036:in migrate' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/tasks/database_tasks.rb:238:in migrate’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/railties/databases.rake:86:in block (3 levels) in <top (required)>' /usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/railties/databases.rake:84:in each’
/usr/share/gems/gems/activerecord-6.0.4.7/lib/active_record/railties/databases.rake:84:in block (2 levels) in <top (required)>' /usr/share/gems/gems/rake-13.0.1/exe/rake:27:in <top (required)>’
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

I’m totally lost here so I would really appreciate if someone could point me into the right path to solve this problem.

Regards,
foreman01

Hi,

you have definetly misunderstood something here.
The foreman-db parameters are for the database foreman should be using, not for PuppetDB.
PuppetDB support is available as a plugin to Foreman.
You should take a look at foreman-installer --full-help, and if you are interested in the puppetdb stuff, grep that output for “puppetdb”.
You should definetly drop those foreman-db parameters from your installation to install postgres locally on your server or use another dedicated DB server for that task.

Hope this helps :slight_smile:

Hi Areyus,

Thanks for answering.
The truth is that after having a look at the full-help, it remains quite complicated to understand what options to add to the installer.
What I want to achieve is to just use foreman Web UI and use the existing puppet server I have so it can show there the existing info on registered nodes.

So as per your answer, I should remove the foreman-db commands and to allow foreman install locally its own postgresql db, right?

Another thing is that if I run the installer without a local puppet server installation, what should be the options to tell foreman what puppet server to connect to and from which database retrieve information?
Do I need a proxy for that?

I have found a possible answer from user ekohl in this link Installation of 3.1 without Puppet fails - #3 by lzap
on how to install foreman without puppet but I can’t see there how to point it to any other existing DB or puppet server so it can connect and retrieve data to show on the web ui.

I don’t know if I explained it correctly so you can understand what I’m trying to achieve here.

Regards,
foreman01

Can any of the experienced users clarify me if the scenario I try to achieve is actually doable: a standalone foreman that connects to an existing Puppet server with its own DB?
I was looking through the Tutorials - TheForeman page and couldn’t find anything similar and the scenarios suggested here Foreman :: Manual are not exactly what I need so I would really appreciate if someone could point me to the right command and parameters to run my POC.

Regards,

foreman01

Could you elaborate a little further, what your actual goals are?
It is hard to recommend something if it is unclear what you are trying to achieve. Do you want to run Foreman solely as a Puppet ENC? Do you want to do provisioning with it? Are you looking for an alternative to Puppetboard or something alike?

Regards

Hi areyus,
You are right: I agree that I need to explain more in detail what I’m actually trying to achieve with this actual installation of foreman.
Basically, we want to see if we can have the same functionality we actually have with our actual Puppet Enterprise infra but with Puppet Open Source and Foreman as a POC that it can be done.
So far, in our PE, we deploy new servers, install the agent pointing to the PE master, some modules are run to configure them and the servers are registered and shown in the PE Web UI for monitoring purposes.
In Open Source, we achieved the same when deploying new servers but the part missing was the Web UI, that we try to cover by using Foreman and learn how to use it to show the registered servers for reporting/monitoring purposes.
I managed to install Foreman on the same server we run our Puppet Open Source with Puppet DB, so that was a first step already.
I did it just by running the below command:
foreman-installer --foreman-initial-admin-username=admin --foreman-initial-admin-password=foreman

I can see in the Web UI → Hosts → All hosts the actual Puppet master but I can’t see any of the other two servers I have actually running with their puppet agent pointing to that master.
My first innocent thought was that they should be “recognized” by Foreman “somehow” and shown in the Web UI automatically, but after reading some other threads on the matter, it seems that I probably need to “register” them manually by running some kind of script/template I have not realize yet.
Just to note that we don’t use subscription-manager on the systems.

That was a small elaboration on what do I need to achieve and what I have managed to do so far.
Hope this clarified it a little.

Regards,

Just found the below link and reading through it :slight_smile::

https://theforeman.org/2020/12/how-to-start-with-foreman.html

Regards,

The setup you currently have should be about what you wanted to achive.
On the case of the two puppet agent hosts not showing up in your Forman: There is a setting under “Administer → Settings → Facts” called “Create new host when facts are uploaded” that should trigger host creation on a Puppet run. What prbably has happened is that the hosts are not assigned to any organization and location when they were created. You should have dropdown menus in the top blue bare, next to the foreman logo. Use both and select “Any Organization” and “Any Location” on both of them and check if you can see your hosts.
If yes, everything works as expected and you can assign org/loc to your hosts via the menus. You can also set facts on your host before the first puppetrun (eg via key-value fact files during deployment) that contain the organization and location name where the host should be placed after importing it from facts. The default names for these facts are “foreman_organization” and “foreman_location”, but both can be changed in the settings (once again, “Administer → Settings → Facts”)

Hope this helps :slight_smile:

Hi areyus,
Thanks for the clarifications. I can see the hosts now in the Web UI and had the opportunity to try as well the hammer command for creating/updating hosts.
One thing that still don’t understand is that under Monitor → Facts I see only listed the master itself and its facts but no sign of the other two servers registered.
Is this something expected or do I need to configure some extra option to see the clients facts listed there?

Regards,
foreman01

If everything is set up correctly you should see the other hosts’ facts as well.
Do you see the Puppet Reports of your hosts in Foreman? You should find those either via the host’s page or under “Monitor → Config Management”
To be honest, I am not entirely sure what a freshly installed Foreman looks like these days, since my instances have all been installed in 2016. What you might want to do is run foreman-installer --enable-foreman-plugin-puppet --enable-foreman-cli-puppet --foreman-proxy-puppet=true --foreman-proxy-puppetca=true --puppet-server-puppetdb-host=puppetdb.example.com --puppet-server-reports=foreman,puppetdb --puppet-server-storeconfigs-backend=puppetdb. I think enabling the Puppet features is still default, but it won’t hurt to set them explicitly. The last 3 arguments will enable PuppetDB support if you have not yet done so.
I will be out of office for the next three weeks, so I won’t be able to help any further during that time if this does not solve your problems. Maybe someone else will chime in here or otherwise, feel free to open a new topic for any further explicit problems you might face :slight_smile:

I can confirm that I see the Puppet Reports for servers under “Monitor → Config Management” but noticed that only for the two hosts that are located in the “production” environment and not the third one which had no environment defined so I guess this is actually expected as well.
Thanks for the extra commands: I will definitely give them a try and see if something changes.
Have a nice time! :slight_smile:

1 Like