Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

zabbix_user_directory is not idempotent #1407

Open
ohmer1 opened this issue Oct 24, 2024 · 0 comments
Open

zabbix_user_directory is not idempotent #1407

ohmer1 opened this issue Oct 24, 2024 · 0 comments

Comments

@ohmer1
Copy link

ohmer1 commented Oct 24, 2024

SUMMARY

The zabbix_user_directory module is not idempotent. It always report a change when I run the task you will find in the steps to reproduce section bellow.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

zabbix_user_directory

ANSIBLE VERSION
  config file = /home/user/git/conformite/ansible.cfg
  configured module search path = ['/home/user/git/conformite/library']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/user/git/conformite/collections
  executable location = /usr/bin/ansible
  python version = 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True
CONFIGURATION
NSIBLE_FORCE_COLOR(/home/user/git/conformite/ansible.cfg) = True
ANSIBLE_NOCOWS(/home/user/git/conformite/ansible.cfg) = True
CALLBACKS_ENABLED(/home/user/git/conformite/ansible.cfg) = ['profile_roles', 'timer', 'profile_tasks']
COLLECTIONS_PATHS(/home/user/git/conformite/ansible.cfg) = ['/home/user/git/conformite/collections']
COLOR_CHANGED(/home/user/git/conformite/ansible.cfg) = yellow
COLOR_DEBUG(/home/user/git/conformite/ansible.cfg) = dark gray
COLOR_DEPRECATE(/home/user/git/conformite/ansible.cfg) = purple
COLOR_DIFF_ADD(/home/user/git/conformite/ansible.cfg) = green
COLOR_DIFF_LINES(/home/user/git/conformite/ansible.cfg) = cyan
COLOR_DIFF_REMOVE(/home/user/git/conformite/ansible.cfg) = red
COLOR_ERROR(/home/user/git/conformite/ansible.cfg) = red
COLOR_HIGHLIGHT(/home/user/git/conformite/ansible.cfg) = white
COLOR_OK(/home/user/git/conformite/ansible.cfg) = green
COLOR_SKIP(/home/user/git/conformite/ansible.cfg) = cyan
COLOR_UNREACHABLE(/home/user/git/conformite/ansible.cfg) = red
COLOR_VERBOSE(/home/user/git/conformite/ansible.cfg) = blue
COLOR_WARN(/home/user/git/conformite/ansible.cfg) = bright purple
CONFIG_FILE() = /home/user/git/conformite/ansible.cfg
DEFAULT_BECOME_ASK_PASS(/home/user/git/conformite/ansible.cfg) = True
DEFAULT_FORKS(/home/user/git/conformite/ansible.cfg) = 8
DEFAULT_GATHERING(/home/user/git/conformite/ansible.cfg) = smart
DEFAULT_GATHER_TIMEOUT(/home/user/git/conformite/ansible.cfg) = 120
DEFAULT_HOST_LIST(/home/user/git/conformite/ansible.cfg) = ['/home/user/git/conformite/inventaire']
DEFAULT_JINJA2_NATIVE(/home/user/git/conformite/ansible.cfg) = False
DEFAULT_MANAGED_STR(/home/user/git/conformite/ansible.cfg) = Généré par Ansible - vos modifications seront détectées et écrasées!
DEFAULT_MODULE_PATH(/home/user/git/conformite/ansible.cfg) = ['/home/user/git/conformite/library']
DEFAULT_MODULE_UTILS_PATH(/home/user/git/conformite/ansible.cfg) = ['/home/user/git/conformite/module_utils']
DEFAULT_ROLES_PATH(/home/user/git/conformite/ansible.cfg) = ['/home/user/git/conformite/roles']
DEFAULT_STDOUT_CALLBACK(/home/user/git/conformite/ansible.cfg) = default
DEFAULT_TIMEOUT(/home/user/git/conformite/ansible.cfg) = 60
DIFF_ALWAYS(/home/user/git/conformite/ansible.cfg) = True
DIFF_CONTEXT(/home/user/git/conformite/ansible.cfg) = 3
GALAXY_SERVER(/home/user/git/conformite/ansible.cfg) = https://galaxy.ansible.com
HOST_KEY_CHECKING(/home/user/git/conformite/ansible.cfg) = False
INTERPRETER_PYTHON(/home/user/git/conformite/ansible.cfg) = auto
INVENTORY_IGNORE_EXTS(/home/user/git/conformite/ansible.cfg) = ['.pyc', '.pyo', '.swp', '.bak', '~', '.rpm', '.md', '.txt', '~', '.orig', '.ini', '.c>
MAX_FILE_SIZE_FOR_DIFF(/home/user/git/conformite/ansible.cfg) = 1000000
SHOW_CUSTOM_STATS(/home/user/git/conformite/ansible.cfg) = True
OS / ENVIRONMENT / Zabbix Version
STEPS TO REPRODUCE

Here a task always running with a changed state.

- name: 'serveur/configuration | user directory'
  community.zabbix.zabbix_user_directory:
    name: 'AD {{ item }}'
    idp_type: 'ldap'
    host: '{{ zabbix_ldap_host[item] }}'
    port: '{{ zabbix_ldap_port }}'
    base_dn: '{{ zabbix_ldap_base_dn }}'
    group_basedn: '{{ zabbix_ldap_group_basedn }}'
    search_attribute: 'sAMAccountName'
    group_name: 'sAMAccountName'
    group_member: 'member'
    user_ref_attr: 'distinguishedName'
    group_filter: '(&(objectclass=group)(%{groupattr}:1.2.840.113556.1.4.1941:=%{ref}))'
    user_username: 'givenName'
    user_lastname: 'sn'
    bind_dn: '{{ zabbix_ldap_bind_dn }}'
    bind_password: '{{ zabbix_bind_password }}'
    search_filter: '{{ zabbix_ldap_search_filter }}'
    provision_status: yes
    provision_groups:
      - name: 'acces_zabbix_admin'
        role: 'Admin role'
        user_groups:
          - 'Zabbix administrators'
      - name: 'acces_zabbix_superadmin'
        role: 'Super admin role'
        user_groups:
          - 'Zabbix administrators'
    provision_media:
      - name: 'Courriel'
        mediatype: 'Email (HTML)'
        attribute: 'mail'
  loop:
    - 'principal'
    - 'secondaire'
EXPECTED RESULTS

The task should return OK if there is no change.

ACTUAL RESULTS
changed: [server] => (item=principal) => 
    ansible_loop_var: item
    changed: true
   ...
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant