ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
816 stars 1.5k forks source link

ipa host disabled bug #1094

Open leagueofsoups opened 3 years ago

leagueofsoups commented 3 years ago
SUMMARY

Can't disable ipa host

https://github.com/ansible-collections/community.general/blob/main/plugins/modules/identity/ipa/ipa_host.py#L229 when I try disable host module_host always empty list (because module_host without state arg) if host already exist I got https://github.com/ansible-collections/community.general/blob/main/plugins/modules/identity/ipa/ipa_host.py#L253, but diff list empty

I low experience with debug ansible modules, but use patch like this. This is work for disable host on my ipa server.

if len(diff) > 0:
  ...
elif state == "disabled":
  changed = True
  client.host_disable(name=name)
  return ...
ISSUE TYPE
COMPONENT NAME

ipa_host

ANSIBLE VERSION
  config file = None
  configured module search path = ['/Users/sergejsmirnov/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.8.5 (default, Jul 21 2020, 10:48:26) [Clang 11.0.3 (clang-1103.0.32.62)]
CONFIGURATION
OS / ENVIRONMENT

MacOS

STEPS TO REPRODUCE
- name: disable host if exist
  hosts: IDM
  tasks:
    - name: disable host
      community.general.ipa_host:
        fqdn: target_fqdn
        state: disabled
        validate_certs: no
        ipa_pass: pass
        ipa_user: user
        ipa_host: host
EXPECTED RESULTS

have change state, have disabled host

ACTUAL RESULTS

have green state, nothing happens

ansibullbot commented 3 years ago

Files identified in the description: None

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 3 years ago

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 3 years ago

cc @Akasurde @Nosmoht @fxfitz click here for bot help

ansibullbot commented 3 years ago

cc @justchris1 click here for bot help

ansibullbot commented 1 year ago

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help