ansible / ansible-modules-extras

Ansible extra modules - these modules ship with ansible
948 stars 1.46k forks source link

IPA: can't set password for ipa_user module #3545

Closed gelato closed 7 years ago

gelato commented 7 years ago
ISSUE TYPE
COMPONENT NAME

ipa

ANSIBLE VERSION
ansible 2.3.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
CONFIGURATION
OS / ENVIRONMENT
Linux Mint 18 ##### SUMMARY

Can't add password for ipa user through ipa_user module - password is always empty in IPA

STEPS TO REPRODUCE

Run ipa_user module with all required fields and password field filled.

- name: Ensure user is present
    ipa_user:
      name: "{{ item.0.login }}"
      state: present
      givenname: "{{ item.1.first_name }}"
      sn: "{{ item.1.last_name }}"
      mail: "{{ item.1.mail }}"
      password: 123321
      telephonenumber: "{{ item.1.telnum }}"
      title: "{{ item.1.jobtitle }}"
      ipa_host: "{{ global_host }}"
      ipa_user: "{{ global_user }}"
      ipa_pass: "{{ global_pass }}"
      validate_certs: no
    with_subelements:
      - "{{ users_to_add }}"
      - personal_data
    ignore_errors: true

users_to_add:
    - username: Harley Quinn
      login: 90987264
      password: "adasdk212masd"
      cluster_zone: Default
      group: mininform
      group_desc: "Some random data for description"
      personal_data:
        - first_name: Harley
          last_name: Quinn
          mail: harley@gmail.com
          telnum: +79788880132
          jobtitle: Minister
    - username: Vasya Pupkin
      login: 77777777
      password: "adasdk212masd"
      cluster_zone: Default
      group: mininform
      group_desc: "Some random data for description"
      personal_data:
        - first_name: Vasya
          last_name: Pupkin
          mail: vasya@gmail.com
          telnum: +7970000805
          jobtitle: Vice minister
EXPECTED RESULTS

User creation with password expected.

ACTUAL RESULTS

User created has no password set. And module does not change user credentials (password) if you change it in playbook.

ok: [ipa111.krtech.loc] => (item=({u'username': u'Harley Quinn', u'group': u'mininform', u'cluster_zone': u'Default', u'group_desc': u'Some rando
m data for description', u'login': 90987264, u'password': u'adasdk212masd'}, {u'mail': u'harley@gmail.com', u'first_name': u'Harley', u'last_name
': u'Quinn', u'jobtitle': u'Minister', u'telnum': 79788880132}))
ok: [ipa111.krtech.loc] => (item=({u'username': u'Vasya Pupkin', u'group': u'mininform', u'cluster_zone': u'Default', u'group_desc': u'Some rando
m data for description', u'login': 77777777, u'password': u'adasdk212masd'}, {u'mail': u'vasya@gmail.com', u'first_name': u'Vasya', u'last_name':
 u'Pupkin', u'jobtitle': u'Vice minister', u'telnum': 7970000805}))
gelato commented 7 years ago

@Nosmoht Hello, i found another bug... It's very frustrating to have no means to set a password for user...

Nosmoht commented 7 years ago

Hi @gelato,

thanks for reporting the issue.

I simply forgot to add the code to set the passwords.

But thanks to @mkrupcale this is already fixed with https://github.com/ansible/ansible-modules-extras/pull/3485.

jctanner commented 7 years ago

resolved_by_pr https://github.com/ansible/ansible-modules-extras/pull/3485

ansibot commented 7 years ago

This repository has been locked. All new issues and pull requests should be filed in https://github.com/ansible/ansible

Please read through the repomerge page in the dev guide. The guide contains links to tools which automatically move your issue or pull request to the ansible/ansible repo.

ansibot commented 7 years ago

This issue was migrated to https://github.com/ansible/ansible/issues/29423