Bug 1672731 - Unable to pass array or hash as Ansible variable in Satellite 6.4
Summary: Unable to pass array or hash as Ansible variable in Satellite 6.4
Keywords:
Status: CLOSED DUPLICATE of bug 1634755
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible
Version: 6.4
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Lukas Pramuk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-02-05 17:21 UTC by Suraj Patil
Modified: 2019-08-12 19:32 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-24 19:27:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Suraj Patil 2019-02-05 17:21:48 UTC
Description of problem:

Suppose below is the structure of the yaml file and now we need to pass variables hostname and iburst. 

-------------------------------------------------------------
- hosts: all
  vars:
    timesync_ntp_servers:
     - hostname: 192.168.123.10
       iburst: yes
     - hostname: 192.168.123.20
       iburst: yes
    timesync_ntp_provider: chrony
    timesync_step_threshold: 1.0
    timesync_dhcp_ntp_servers: no
  roles:
    - linux-system-roles.timesync
-------------------------------------------------------------

Because of the following bug we cannot provide value to global parameter like - "[  { 'hostname': '10.10.10.10', 'iburst': 'yes' }, { 'hostname': '20.20.20.20', 'iburst': 'yes' }]"

https://bugzilla.redhat.com/show_bug.cgi?id=1402136


Version-Release number of selected component (if applicable):
Red Hat Satellite 6.4

Steps to Reproduce:
1. yum install  rhel-system-roles 
2. Import timesync role in satellite
3. try to set variables. 

Actual results:
Unable to pass "[  { 'hostname': '10.10.10.10', 'iburst': 'yes' }, { 'hostname': '20.20.20.20', 'iburst': 'yes' }]" in global/host parameter.

Expected results:

This functionality is present in upstream foreman. 

https://www.theforeman.org/plugins/foreman_ansible/2.x/index.html#4.1.2ImportingVariables

Comment 8 Marek Hulan 2019-05-24 19:28:32 UTC
This functionality is provided by upcoming Ansible Variables feature


Note You need to log in before you can comment on or make changes to this bug.