Bug 2127447

Summary: [ansible-freeeipa] It should not be possible to disable SID from ipa config module, and the error message should be clear
Product: Red Hat Enterprise Linux 8 Reporter: Varun Mylaraiah <mvarun>
Component: ansible-freeipaAssignee: Rafael Jeffman <rjeffman>
Status: CLOSED ERRATA QA Contact: Varun Mylaraiah <mvarun>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.8CC: ipa-qe, mjurasek, rjeffman, twoerner
Target Milestone: rcKeywords: Regression, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ansible-freeipa-1.9.0-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2127446
: 2135754 (view as bug list) Environment:
Last Closed: 2023-05-16 08:15:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2127446    
Bug Blocks: 2135754    

Description Varun Mylaraiah 2022-09-16 11:30:45 UTC
+++ This bug was initially created as a clone of Bug #2127446 +++

Description of problem:
Required a clear error message while disabling SID (enable_sid: no) from ipa config module

Version-Release number of selected component (if applicable):
 1.8.4-1

How reproducible:
100%

Steps to Reproduce:

cat config_module.yml
---
- name: Playbook to verify error message
  hosts: ipaserver
 
  tasks:
  - ipaconfig:
      ipaadmin_password: <xxxxxxx>
      enable_sid: no


[root@ansible ~]# ansible-playbook -vv -i inventory/config.hosts config_module.yml
ansible-playbook [core 2.13.3]
  config file = /root/ansible.cfg
PLAYBOOK: config_module.yml ********************************************************************
1 plays in config_module.yml
 
PLAY [Playbook to verify error message] ***********************
 
TASK [Gathering Facts] *************************************************************************
task path: /root/config_module.yml:2
ok: [master.ipadomain.test]
META: ran handlers
 
TASK [ipaconfig] *******************************************************************************
task path: /root/config_module.yml:6
fatal: [master.ipadomain.test]: FAILED! => {"changed": false, "msg": "unhashable type: 'dict'"}

Comment 1 Rafael Jeffman 2022-09-21 22:34:58 UTC
https://github.com/freeipa/ansible-freeipa/pull/921

Comment 7 Varun Mylaraiah 2022-12-19 10:40:30 UTC
Verified
ansible-2.9.27-1.el8ae.noarch
ansible-freeipa-1.9.0-1.el8.noarch

Passed	ansible_freeipa_tests/config/test_config.py::TestConfigInvalid::test_enable_sid_with_no

INFO     pytest_multihost.host.Host.ansible.ParamikoTransport:transport.py:318 RUN ['ansible-playbook', '--ssh-extra-args="-o StrictHostKeyChecking=no"', '-vv', '-i', 'inventory/config.hosts', 'config_module.yml']
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:519 RUN ['ansible-playbook', '--ssh-extra-args="-o StrictHostKeyChecking=no"', '-vv', '-i', 'inventory/config.hosts', 'config_module.yml']
DEBUG    paramiko.transport:channel.py:1212 [chan 55] Sesch channel 55 request ok
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 -bash: line 1: cd: /root/multihost_tests: No such file or directory
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 -bash: line 2: /root/multihost_tests/env.sh: No such file or directory
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 ansible-playbook 2.9.27
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563   config file = /etc/ansible/ansible.cfg
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563   configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563   ansible python module location = /usr/lib/python3.6/site-packages/ansible
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563   executable location = /usr/bin/ansible-playbook
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563   python version = 3.6.8 (default, Oct 25 2022, 12:51:08) [GCC 8.5.0 20210514 (Red Hat 8.5.0-17)]
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 Using /etc/ansible/ansible.cfg as config file
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 Skipping callback 'actionable', as we already have a stdout callback.
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 Skipping callback 'counter_enabled', as we already have a stdout callback.
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 Skipping callback 'debug', as we already have a stdout callback.
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 Skipping callback 'dense', as we already have a stdout callback.
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 Skipping callback 'dense', as we already have a stdout callback.
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 Skipping callback 'full_skip', as we already have a stdout callback.
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 Skipping callback 'json', as we already have a stdout callback.
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 Skipping callback 'minimal', as we already have a stdout callback.
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 Skipping callback 'null', as we already have a stdout callback.
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 Skipping callback 'oneline', as we already have a stdout callback.
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 Skipping callback 'selective', as we already have a stdout callback.
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 Skipping callback 'skippy', as we already have a stdout callback.
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 Skipping callback 'stderr', as we already have a stdout callback.
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 Skipping callback 'unixy', as we already have a stdout callback.
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 Skipping callback 'yaml', as we already have a stdout callback.
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 PLAYBOOK: config_module.yml ****************************************************
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 1 plays in config_module.yml
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 PLAY [Playbook to ensure SID disables(enable_sid no) is not possible.] *********
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 TASK [Gathering Facts] *********************************************************
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 task path: /root/config_module.yml:2
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 ok: [master.ipadomain.test]
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 META: ran handlers
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 TASK [ipaconfig] ***************************************************************
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 task path: /root/config_module.yml:6
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 fatal: [master.ipadomain.test]: FAILED! => {"changed": false, "msg": "SID cannot be disabled."}
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 PLAY RECAP *********************************************************************
DEBUG    pytest_multihost.host.Host.ansible.cmd55:transport.py:563 master.ipadomain.test      : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   


Based on the test result, marking the bug Verified

Comment 10 errata-xmlrpc 2023-05-16 08:15:55 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 (ansible-freeipa bug fix and enhancement update), 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/RHEA-2023:2752