Bug #26909
closedUnable to add smartclass parameter with matcher fqdn, when hosts installed with disabled option "add domain to hostname"
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:
- 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.
- hammer sc-param add-matcher --match 'fqdn=rhelhosta' --value 'Good Morning!' --smart-class-parameter content --puppet-class motd
Override value created.