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