Description of problem: I can create duplicate ansible variables of the same name for the same role. These duplicates can be of different types Duplicates shouldn't be allowed similarly to puppet classes Version-Release number of selected component (if applicable): Satellite-6.6.0 Snap14 How reproducible: deterministic Steps to Reproduce: 1. Import ansible roles: # hammer ansible roles import --proxy-id 1 2. Create ansible variable "my_var" assigned to "theforeman.foreman_scap_client" role: # hammer ansible variables create --variable my_var --variable-type string --ansible-role theforeman.foreman_scap_client Ansible variable [my_var] was created. 3. Try to create variable of the same name once again: # hammer ansible variables create --variable my_var --variable-type boolean --ansible-role theforeman.foreman_scap_client Ansible variable [my_var] was created. Actual results: # hammer ansible variables list --search name=my_var ---|----------|---------------|---------|------------------------------- ID | VARIABLE | DEFAULT VALUE | TYPE | ROLE ---|----------|---------------|---------|------------------------------- 28 | my_var | | boolean | theforeman.foreman_scap_client 27 | my_var | | string | theforeman.foreman_scap_client ---|----------|---------------|---------|------------------------------- >>> duplicate vars for one role are allowed Expected results: 2nd "my_var" creation fails with something like "Validation failed: my_var for the role already exists"
Created redmine issue https://projects.theforeman.org/issues/27663 from this bug
Upstream bug assigned to oprazak
VERIFIED. @Satellite 6.6.0 Snap21 tfm-rubygem-foreman_ansible-3.0.7.1-1.el7sat.noarch by the reproducer described in comment#0: # hammer ansible roles import --proxy-id 1 Result: The following ansible roles were changed Imported: 1) RedHatInsights.insights-client 2) theforeman.foreman_scap_client # hammer ansible variables create --variable my_var --variable-type string --ansible-role theforeman.foreman_scap_client Ansible variable [my_var] was created. # hammer ansible variables create --variable my_var --variable-type boolean --ansible-role theforeman.foreman_scap_client Could not create the ansible variable: Key has already been taken >>> duplicate ansible vars for a role are no longer allowed
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