Project

General

Profile

Actions

Bug #26909

closed

Unable to add smartclass parameter with matcher fqdn, when hosts installed with disabled option "add domain to hostname"

Added by Hao Yu about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Parameters
Target version:
-
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Description of problem:
When a host is installed with name and the satellite option "append domain name for hosts" is disabled, it's not possible to define a sc-parameter using hammer, which matches on fqdn.

Version-Release number of selected component (if applicable):
tfm-rubygem-hammer_cli-0.13.1.1-1.el7sat.noarch

How reproducible:
always

Steps to Reproduce:
1. hammer settings set --name 'append_domain_name_for_hosts' --value 'false'
2. hammer host create \
--ask-root-password 0 \
--build 1 \
--provision-method build \
--domain "crazy.lab" \
--hostgroup "HG-RHEL7-DEV" \
--subnet "crazy.lab" \
--organization "CRAZY LAB" \
--location "LOCAL" \
--name "rhelhosta" \
--compute-resource "libvirt@CHUNK"

3. hammer host start --name "rhelhosta"
4. hammer sc-param add-matcher --match 'fqdn=rhelhosta.crazy.lab' --value 'Good Morning' --smart-class-parameter content --puppet-class motd

Actual results:
Could not create the override value:
Validation failed: Match fqdn=rhelhosta.crazy.lab does not match an existing host

Expected results:
A sc-parameter is added with matcher fqdn=rhelhosta.crazy.lab

Additional info:

  1. hammer fact list --search "rhelhost*"
    ----------|----------------------|--------------------
    HOST | FACT | VALUE
    ----------|----------------------|--------------------
    rhelhosta | hostname | rhelhosta
    rhelhosta | networking::hostname | rhelhosta
    rhelhosta | clientcert | rhelhosta
    rhelhosta | fqdn | rhelhosta.crazy.lab
    rhelhosta | networking::fqdn | rhelhosta.crazy.lab
    ----------|----------------------|--------------------

It's possible to add this parameter using 'hostname', but this results in not working puppet-rule, as fqdn=rhelhosta does not match facter-result.

  1. hammer sc-param add-matcher --match 'fqdn=rhelhosta' --value 'Good Morning!' --smart-class-parameter content --puppet-class motd
    Override value created.
Actions #1

Updated by The Foreman Bot about 5 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/6830 added
Actions #2

Updated by Ondřej Ezr about 5 years ago

  • Category set to Parameters
  • Triaged changed from No to Yes
  • Fixed in Releases 1.23.0 added
Actions #3

Updated by Hao Yu about 5 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF