Description of problem: We can't choose which roles we want to import. The command import all available roles. Version-Release number of selected component (if applicable): 6.4#13 How reproducible: 100% Steps to Reproduce: 1. We have got a satellite 6.4 > hammer ansible roles import Result: The following ansible roles were changed Imported: 1) geerlingguy.ntp > hammer ansible roles import --help Usage: hammer ansible roles import [OPTIONS] Options: --location LOCATION_NAME Location name --location-id LOCATION_ID --location-title LOCATION_TITLE Location title --organization ORGANIZATION_NAME Organization name --organization-id ORGANIZATION_ID Organization ID --organization-title ORGANIZATION_TITLE Organization title --proxy-id PROXY_ID Capsule to import from -h, --help Print help Actual results: We can't choose which roles we want to import. Expected results: We can choose which roles we want to import. Something same as in WebUI. Additional info: bz1590854
Sorry for taking so long to reply. I'm not sure if it is actually the hammer plugin problem, since hammer relies on Foreman's Ansible plugin API and the endpoint for the import command doesn't provide options for selecting specific roles. It just import all of them from a specific Smart proxy.
Hi Oleh, missing API in backend is not a reason for unsolving of this issue. I don't say it have to be fixed in this version of satellite, but it is really important for automatization.
Oleh, could you please look at how much work it would be to extend foreman_ansible API so that it allows what Martin asks for? I think it would be a good addition. Once API is there, we could enhance also the hammer plugin.
Marek, Martin, of course. This addition (both API and plugin) is my next target after solving the second issue.
Created redmine issue http://projects.theforeman.org/issues/25446 from this bug
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25446 has been resolved.
VERIFIED. @satellite-6.6.0-5.beta.el7sat.noarch tfm-rubygem-hammer_cli_foreman_ansible-0.3.0-2.el7sat.noarch ansible-2.8.0-1.el7ae.noarch by the following set of commands: # hammer ansible roles import --help Usage: hammer ansible roles import [OPTIONS] Options: --location LOCATION_NAME Location name --location-id LOCATION_ID --location-title LOCATION_TITLE Location title --organization ORGANIZATION_NAME Organization name --organization-id ORGANIZATION_ID Organization ID --organization-title ORGANIZATION_TITLE Organization title --proxy-id PROXY_ID Capsule to import from --role-names ROLE_NAMES Ansible role names to import Comma separated list of values. Values containing comma should be quoted or escaped with backslash. # hammer ansible roles import --proxy-id 1 --role-names geerlingguy.ntp,linuxhq.setup Result: The following ansible roles were changed Imported: 1) linuxhq.setup 2) geerlingguy.ntp [root@dell-per415-01 ~]# hammer ansible roles list ---|-----------------|-------------------- ID | NAME | IMPORTED AT ---|-----------------|-------------------- 5 | linuxhq.setup | 2019/06/10 12:03:52 6 | geerlingguy.ntp | 2019/06/10 12:03:52 ---|-----------------|-------------------- >>> In CLI the user has now some sort of control of what is being imported and what not
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:3172