Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1785231 - Ansible Variable override to false does not gets reflected on client machine on Red Hat Satellite 6.
Summary: Ansible Variable override to false does not gets reflected on client machine ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible - Configuration Management
Version: 6.6.0
Hardware: x86_64
OS: Linux
high
medium
Target Milestone: 6.8.0
Assignee: satellite6-bugs
QA Contact: Lukas Pramuk
URL:
Whiteboard:
: 1805560 1810283 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-19 13:01 UTC by Amaani S Karimi
Modified: 2024-10-01 16:25 UTC (History)
6 users (show)

Fixed In Version: tfm-rubygem-foreman_ansible-5.0.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-27 12:59:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 29138 0 Normal Closed Ansible boolean variables overriden with False are not showing in the host YAML output 2021-01-08 12:57:32 UTC
Red Hat Knowledge Base (Solution) 4674351 0 None None None 2019-12-19 13:09:51 UTC
Red Hat Product Errata RHSA-2020:4366 0 None None None 2020-10-27 12:59:51 UTC

Comment 3 Alexey Masolov 2020-02-23 23:04:04 UTC
*** Bug 1805560 has been marked as a duplicate of this bug. ***

Comment 5 Alexey Masolov 2020-02-24 03:24:01 UTC
So, to address the problem with saving boolean parameters as true/false instead of string values 'true'/'false' we need to cherry pick this https://github.com/theforeman/foreman_ansible/pull/293/files into Satellite.

The YAML render should be also fixed by implementing the proposed change. I'll create a PR for that.

Comment 6 Bryan Kearney 2020-02-28 15:00:48 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/29138 has been resolved.

Comment 7 Tomer Brisker 2020-08-24 10:57:08 UTC
*** Bug 1810283 has been marked as a duplicate of this bug. ***

Comment 8 Lukas Pramuk 2020-10-06 08:55:27 UTC
VERIFIED.

@Satellite 6.8.0 Snap18
tfm-rubygem-foreman_ansible-5.1.3-1.el7sat.noarch

by the reproducer described in comment#0 and comment#4:

1) Import the role "linux-system-roles.timesync" and its variables (works for any role with boolean variables)

# ansible-galaxy install -p /etc/ansible/roles linux-system-roles.timesync
# hammer ansible roles import --proxy-id 1
# hammer ansible variables import --proxy-id 1

2) Associate this role to an host

# hammer host ansible-roles assign --name $(hostname) --ansible-roles linux-system-roles.timesync

3) Override variable "timesync_dhcp_ntp_servers" and leave the default value to 'false'

4) Access the YAML page of your host and check for the variable "timesync_dhcp_ntp_servers"

---
parameters:
  timesync_dhcp_ntp_servers: false

>>> boolean parameter set to false is still visible


5) Change the overridden value to 'true' and check its representation in foreman database

# PGPASSWORD=$(awk '/password:/{gsub(/"/,"",$2);print$2}' /etc/foreman/database.yml) psql -U foreman -d foreman -h 127.0.0.1
psql (12.1)
Type "help" for help.

foreman=> select default_value from lookup_keys where key like 'timesync_dhcp_ntp_servers';
 default_value 
---------------
 --- true     +
 ...          +
 
(1 row)

>>> boolean variable is stored as a boolean and not as a string

Comment 11 errata-xmlrpc 2020-10-27 12:59:35 UTC
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 (Important: Satellite 6.8 release), 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-2020:4366


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