user1980099
user1980099

Reputation: 643

Ansible - Changing user password on ldap server

I use Ansible to add users to the ldap server.

First time user created. When I run Ansible again and I want only to change user password, which is one of the attribute, it do nothing.

How can I change an atribute of existing user?

In my main.yml file something like:

- name: user entries
  ldap_entry:
    dn: ...
    attributes:
      uidNumber: "{{ item.uidNumber }}"
      gidNumber: "{{ item.gidNumber }}"
      sn: "{{ item.sn }}"
      cn: "{{ item.cn }}"
      userPassword: "{{ item.userPassword }}"
    bind_dn: "..."
    bind_pw: "..."
    state: present
  with_items: "{{ users }}"

Upvotes: 0

Views: 1221

Answers (1)

sebthebert
sebthebert

Reputation: 12507

From the ldap_entry module documentation:

This module only asserts the existence or non-existence of an LDAP entry, not its attributes. To assert the attribute values of an entry, see ldap_attr

Use ldap_attr module.

Upvotes: 2

Related Questions