Project

General

Profile

Actions

Feature #28071

open

Let Hammer edit not storable hosts

Added by Dennis W. over 4 years ago. Updated about 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
API
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:

Description

Problem:
At some point hammer can’t edit a host, e.g. changing the puppet environment. This happens when a change of a host cannot be safed because parameters went missing.

Example:
A new minor release of Debian is available. The host is updated, puppet is running after the update and collects the new os version information. Foreman takes this information and itself updates the host with this new information.
When the new os version has not been configured by now in foreman, meaning configure partition table, bootloader and mirror, then these options will be unset at the host with the new os version.

Now the host can’t be edited anymore because you cannot save your changes without setting these options again. In the same way hammer now is also unable to edit a host.

We’re using hammer inside of Gitlab Pipelines to e.g. change a host back to our production environment and delete a merged branch from foreman. This stops working which ends in much manual work to clean up foreman and get it fixed.

The used command is:
hammer host update --id ${host_id} --environment production

Expected outcome:
When you’re in the host selection, mark a host and choose “change environment” then you’re able to change the puppet environment even when you can’t safe the changes made to a host. Hammer should behave the same way.

Foreman and Proxy versions:
foreman-cli-1.20.2-1.el7.noarch
foreman-1.20.2-1.el7.noarch
tfm-rubygem-foreman_hooks-0.3.15-1.fm1_20.el7.noarch
tfm-rubygem-puppetdb_foreman-5.0.0-1.fm1_20.el7.noarch
foreman-ovirt-1.20.2-1.el7.noarch
tfm-rubygem-foreman_dhcp_browser-0.0.8-3.fm1_20.el7.noarch
tfm-rubygem-foreman_column_view-0.4.0-3.fm1_20.el7.noarch
foreman-debug-1.20.2-1.el7.noarch
foreman-postgresql-1.20.2-1.el7.noarch
foreman-release-scl-7-2.el7.noarch
foreman-libvirt-1.20.2-1.el7.noarch
tfm-rubygem-hammer_cli_foreman-0.15.1-1.el7.noarch
foreman-release-1.20.2-1.el7.noarch
foreman-compute-1.20.2-1.el7.noarch

Foreman and Proxy plugin versions:
tfm-rubygem-hammer_cli-0.15.1-1.el7.noarch
tfm-rubygem-hammer_cli_foreman-0.15.1-1.el7.noarch

Other relevant data:
I checked the release notes from foreman 1.20.2 to 1.23.0 but couldn’t find a note that is related to this issue.

Actions #1

Updated by Oleh Fedorenko over 4 years ago

Hello Dennis,

could you please provide some hammer output? The best will be output that comes in debug mode (hammer -d <command>).

It could be the same known issue related to --environment options that is resolved already as part of https://projects.theforeman.org/issues/23204.

Actions #2

Updated by Dennis W. over 4 years ago

  • Found in Releases hammer-cli-foreman-0.18.0 added
  • Found in Releases deleted (hammer-cli-foreman-0.15.1)

Oleh Fedorenko wrote:

Hello Dennis,

could you please provide some hammer output? The best will be output that comes in debug mode (hammer -d <command>).

It could be the same known issue related to --environment options that is resolved already as part of https://projects.theforeman.org/issues/23204.

Hi,

I've put the output on pastebin: https://pastebin.com/3dm8MSzV

Please note, that we updated foreman to upstream 1.23 so we're running hammer 0.18.0 now.

In my opinion it's good that there is verification for the configuration of a host. But I think there is no need for that regarding puppet environments. I mean, maybe the configuration issue is fixed by changing the puppet environment. We're running about 700 machines in foreman, it's quite some work to change the puppet environments manually.

Actions #3

Updated by Oleh Fedorenko over 4 years ago

  • Project changed from Hammer CLI to Foreman
  • Category set to API

As per discuccion on community.theforeman.org [1] moving this to API component.

[1] - https://community.theforeman.org/t/hammer-cant-edit-host/15738

Actions #4

Updated by Dennis W. about 4 years ago

Hey there,

I just wanted to ask if there are any news on this.

Cheers
Dennis

Actions

Also available in: Atom PDF