Bug 1402134
| Summary: | [RFE] Need Hammer CLI commands to do the HostGroup / Environments associations with Provisioning Template. | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Deepannagaraj Nagarathinam <dnagarat> |
| Component: | Provisioning Templates | Assignee: | Shira Maximov <mshira> |
| Status: | CLOSED ERRATA | QA Contact: | Roman Plevka <rplevka> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 6.2.4 | CC: | bkearney, dhlavacd, jbhatia, jcallaha, mhulan, pcreech, rankumar, rplevka |
| Target Milestone: | 6.5.0 | Keywords: | FutureFeature |
| Target Release: | Unused | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2019-05-14 12:36:19 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Comment 4
Satellite Program
2018-07-24 12:28:44 UTC
Upstream bug assigned to mshira Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/3969 has been resolved. FAILED QA
sat6.5.0 snap 19
The parameter does not seem to be present.
Comparing the code with the commit i noticed, the filename is `combination.rb` instead of `combinations.rb`:
[root@sat-6-5-qa-rhel7 hammer_cli_foreman]# ls combin*
combination.rb
[root@sat-6-5-qa-rhel7 hammer_cli_foreman]# pwd
/opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.15.1/lib/hammer_cli_foreman
[root@sat-6-5-qa-rhel7 ~]# rpm -qa | grep hammer
tfm-rubygem-hammer_cli-0.15.1.1-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_templates-0.1.2-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_docker-0.0.6.1-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_remote_execution-0.1.0-2.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_discovery-1.0.0-3.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_tasks-0.0.13-1.el7sat.noarch
tfm-rubygem-hammer_cli_csv-2.3.1-3.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_ansible-0.1.1-3.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_virt_who_configure-0.0.3-3.el7sat.noarch
tfm-rubygem-hammer_cli_katello-0.16.0.10-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman-0.15.1-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_admin-0.0.8-3.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_bootdisk-0.1.3.3-5.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_openscap-0.1.6-2.el7sat.noarch
[root@sat-6-5-qa-rhel7 ~]# rpm -qa satellite
satellite-6.5.0-7.beta.el7sat.noarch
[root@sat-6-5-qa-rhel7 ~]# hammer template update --help
Usage:
hammer template update [OPTIONS]
Options:
--audit-comment AUDIT_COMMENT
--file TEMPLATE Path to a file that contains the template
--id ID
--location LOCATION_NAME Location name
--location-id LOCATION_ID
--location-ids LOCATION_IDS REPLACE locations with given ids
Comma separated list of values. Values containing comma should be quoted or escaped with backslash
--location-title LOCATION_TITLE Location title
--location-titles LOCATION_TITLES Comma separated list of values. Values containing comma should be quoted or escaped with backslash
--locations LOCATION_NAMES Comma separated list of values. Values containing comma should be quoted or escaped with backslash
--locked LOCKED Whether or not the template is locked for editing
One of true/false, yes/no, 1/0.
--name NAME Name to search by
--new-name NEW_NAME Template name
--operatingsystem-ids OPERATINGSYSTEM_IDS Array of operating system IDs to associate with the template
Comma separated list of values. Values containing comma should be quoted or escaped with backslash
--operatingsystems OPERATINGSYSTEM_TITLES Comma separated list of values. Values containing comma should be quoted or escaped with backslash
--organization ORGANIZATION_NAME Organization name
--organization-id ORGANIZATION_ID Organization ID
--organization-ids ORGANIZATION_IDS REPLACE organizations with given ids.
Comma separated list of values. Values containing comma should be quoted or escaped with backslash
--organization-title ORGANIZATION_TITLE Organization title
--organization-titles ORGANIZATION_TITLES Comma separated list of values. Values containing comma should be quoted or escaped with backslash
--organizations ORGANIZATION_NAMES Comma separated list of values. Values containing comma should be quoted or escaped with backslash
--type TYPE Template type. Eg. snippet, script, provision
-h, --help Print help
[root@sat-6-5-qa-rhel7 ~]# hammer template create --help
Usage:
hammer template create [OPTIONS]
Options:
--audit-comment AUDIT_COMMENT
--file TEMPLATE Path to a file that contains the template
--location LOCATION_NAME Location name
--location-id LOCATION_ID
--location-ids LOCATION_IDS REPLACE locations with given ids
Comma separated list of values. Values containing comma should be quoted or escaped with backslash
--location-title LOCATION_TITLE Location title
--location-titles LOCATION_TITLES Comma separated list of values. Values containing comma should be quoted or escaped with backslash
--locations LOCATION_NAMES Comma separated list of values. Values containing comma should be quoted or escaped with backslash
--locked LOCKED Whether or not the template is locked for editing
One of true/false, yes/no, 1/0.
--name NAME Template name
--operatingsystem-ids OPERATINGSYSTEM_IDS Array of operating system IDs to associate with the template
Comma separated list of values. Values containing comma should be quoted or escaped with backslash
--operatingsystems OPERATINGSYSTEM_TITLES Comma separated list of values. Values containing comma should be quoted or escaped with backslash
--organization ORGANIZATION_NAME Organization name
--organization-id ORGANIZATION_ID Organization ID
--organization-ids ORGANIZATION_IDS REPLACE organizations with given ids.
Comma separated list of values. Values containing comma should be quoted or escaped with backslash
--organization-title ORGANIZATION_TITLE Organization title
--organization-titles ORGANIZATION_TITLES Comma separated list of values. Values containing comma should be quoted or escaped with backslash
--organizations ORGANIZATION_NAMES Comma separated list of values. Values containing comma should be quoted or escaped with backslash
--type TYPE Template type. Eg. snippet, script, provision
-h, --help Print help
In order to use the command properly you should run it like that:
$ hammer template combination --help
Usage:
hammer template combination [OPTIONS] SUBCOMMAND [ARG] ...
Parameters:
SUBCOMMAND Subcommand
[ARG] ... Subcommand arguments
Subcommands:
create Add a template combination
delete Delete a template combination
info Show template combination
list List template combination
update Update template combination
Options:
-h, --help Print help
There seems not to be a way of removing environment or host group from the already existing combination, while i can do that using UI: [root@sat-6-5-qa-rhel7 foreman]# hammer template combination info --id 5 --provisioning-template-id 46 ID: 5 Provisioning template ID: 46 Provisioning template name: Kickstart default Hostgroup ID: 1 Hostgroup name: foo_hg Environment ID: 2 Environment name: foo_env Created at: 2019/03/19 15:32:38 Updated at: 2019/03/19 15:32:38 [root@sat-6-5-qa-rhel7 foreman]# hammer template combination update --id 5 --provisioning-template-id 46 --environment "" Could not update the template combination: Error: environment not found. please try to update the combination with NIL as following: $ hammer template combination update --id 1 --provisioning-template-id 82 --environment NIL --hostgroup shira Template combination updated. VERIFIED on sat6.5.0 snap 20 (In reply to Shira Maximov from comment #11) > please try to update the combination with NIL as following: > $ hammer template combination update --id 1 --provisioning-template-id 82 > --environment NIL --hostgroup shira > Template combination updated. thanks for suggestion, that works Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2019:1222 |