freeipa / ansible-freeipa

Ansible roles and modules for FreeIPA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FreeIPA server in docker container unable to use ipauser module

0lzi opened this issue · comments

commented

Ansible Environment in pipenv

Pipfile

[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

[packages]
ansible = "~=5.0.1"
ansible-lint = "~=5.3.2"
dnspython = "*"
ansible-merge-vars = "*"
python-ldap = ">=3.4.2,<4"
passlib = "*"
bcrypt = "*"
jmespath = "*"
netaddr = "*"


[dev-packages]
black = "==21.12b0"

[requires]
python_version = "3"

IPA Server
container freeipa/freeipa-server:fedora-37

playbook

---
- name: New user
  hosts: ipaserver
  become: true
  vars_files:
    - newuser.yml
  tasks:
  - name: Create new user
    freeipa.ansible_freeipa.ipauser:
      ipaadmin_password: "{{ admin_pass }}"
      users:
        - name: "{{ item.name }}"
          first: "{{ item.first }}"
          last:  "{{ item.last }}"
          email: "{{ item.email }}"
      update_password: on_create
      state: "{{ item.state }}"
    with_items: "{{ user }}"
  register: newuser

newuser.yml

---
codething:
  - name: testuser
    first: test
    last: user 
    email: test.user@domain.co.uk
    groups:
      - everyone
      - ipausers
    state: present

Ansible Error1

"msg": "No module named 'netaddr'"}

Install python3-netaddr on remote host

Ansible Error2

"msg": "No module named 'gssapi'"}

Install python3-gssapi on remote host

Ansble Error3

"No module named 'ipalib'"}

Install python3-ipalib on remote host

Ansible Error4

"[Errno 2] No such file or directory: '/usr/bin/kinit'"} 

Not sure what port the API is using but ports we have open on the container

0.0.0.0:88->88/tcp
80/tcp
0.0.0.0:389->389/tcp
 0.0.0.0:88->88/udp
0.0.0.0:464->464/tcp 
127.0.0.1:53->53/tcp 
127.0.0.1:53->53/udp
 443/tcp, 0.0.0.0:636->636/tcp 
0.0.0.0:464->464/udp, 123/udp

Any help in working out why this isnt working

All the management modules in ansible-freeipa require to be run on a client or server that is part of the IPA domain. The modules are using the IPA API.

commented

Thanks for the info. Will close this.