Project

General

Profile

Actions

Bug #27663

closed

Can create duplicate ansible variables for one role

Added by Ondřej Pražák over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

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

How reproducible:
deterministic

Steps to Reproduce:
1. Import ansible roles:
  1. hammer ansible roles import --proxy-id 1
2. Create ansible variable "my_var" assigned to "theforeman.foreman_scap_client" role:
  1. 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:
  1. hammer ansible variables create --variable my_var --variable-type boolean --ansible-role theforeman.foreman_scap_client
    Ansible variable [my_var] was created.
Actual results:
  1. 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"

Actions #1

Updated by The Foreman Bot over 4 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Ondřej Pražák
  • Pull request https://github.com/theforeman/foreman_ansible/pull/297 added
Actions #2

Updated by Marek Hulán over 4 years ago

  • Subject changed from Can create duplicate ansible variables for one role to Can create duplicate ansible variables for one role
  • Fixed in Releases foreman_ansible 3.0.7 added
Actions #3

Updated by Anonymous over 4 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF