On Mon, Jan 15, 2024 at 12:43 PM slek kus via FreeIPA-users <freeipa-users@lists.fedorahosted.org> wrote:
>
> Hi Rafael, I am lost. I have had it succeed once, running a playbook from AWX which created a testuser. I have been fiddeling with the formatting, reread the documentation but to no avail. Suspecting it is due to something wrong with AWX/execution environments. Below what I do and the results (sorry for the lack of formatting).
>
> This is my requirements.yml:
>
> ---
> collections:
>     - freeipa.ansible_freeipa
>
> Syncing project, I see the collection gets installed:
>
>  "Downloading https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/freeipa-ansible_freeipa-1.12.0.tar.gz to /var/lib/awx/projects/.__awx_cache/_18__test_proj/stage/tmp/ansible-local-84cw0_6878/tmpfa6zncf4/freeipa-ansible_freeipa-1.12.0-n_fjrl7q",
>     "Installing 'freeipa.ansible_freeipa:1.12.0' to '/var/lib/awx/projects/.__awx_cache/_18__test_proj/stage/requirements_collections/ansible_collections/freeipa/ansible_freeipa'",
>     "freeipa.ansible_freeipa:1.12.0 was installed successfully"
>
> This is the playbook:
>
> ---
> - name: Playbook to override an AD user in IdM
>   hosts: all
>   become: false
>
>   tasks:
>     - name: Create override and set key
>       ipaidoverrideuser:
>         ipaadmin_password: "{{ app_password }}"
>         idview: test_idview
>         anchor: bob@domail.invalid
>
> This is the error I get constantly:
>
> ERROR! couldn't resolve module/action 'ipaidoverrideuser'. This often indicates a misspelling, missing collection, or incorrect module path.
> The error appears to be in '/runner/project/test_idoverride.yml': line 7, column 7, but may
> be elsewhere in the file depending on the exact syntax problem.

In your playbook you are using the plugin without the collection name.
This only works using ansible-freeipa's RPM or with the 'collections'
keyword.

If you use the fully qualified name `freeipa.ansible_freeipa.ipaidoverrideuser`
the playbook should work.

Take a look at:
     https://docs.ansible.com/ansible/latest/collections_guide/collections_using_playbooks.html


> The offending line appears to be:
>   tasks:
>     - name: Create override and set key
>       ^ here

Ansible's error reporting is annoying at best, hardly the error is on the
task naming, but on the task itself. Always look at the task as a whole.

hth,

Rafael


> --
> _______________________________________________
> FreeIPA-users mailing list -- freeipa-users@lists.fedorahosted.org
> To unsubscribe send an email to freeipa-users-leave@lists.fedorahosted.org
> Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: https://lists.fedorahosted.org/archives/list/freeipa-users@lists.fedorahosted.org
> Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue



--
Rafael Guterres Jeffman
Senior Software Engineer
FreeIPA - Red Hat