ERROR: argument of type 'NoneType'

Hello everyone,

I’ve been having a lot of trouble to use ansible with passbolt plug-in.
When i try to run a simple request to retrieve a login I have an error :fatal: [localhost]: FAILED! => {
“msg”: “An unhandled exception occurred while running the lookup plugin ‘anatomicjc.passbolt.passbolt’. Error was a <class ‘TypeError’>, original message: argument of type ‘NoneType’ is not iterable. argument of type ‘NoneType’ is not iterable”
}

Here is my playbook:

  • hosts: localhost
    gather_facts: false
    environment:
    PASSBOLT_BASE_URL: “”
    PASSBOLT_GPG_LIBRARY: “gnupg”
    PASSBOLT_FINGERPRINT: “”
    vars:
    passbolt: ‘anatomicjc.passbolt.passbolt’
    user_id: ‘your-user-id’

    tasks:

    • name: “Fetch user login details from Passbolt”
      debug:
      msg: “{{ lookup(passbolt, user_id, per_uuid=‘true’) }}”

I’m using the gpg fingerprint to not use an user + password.
Am I doing something wrong?
Can someone help me find a solution?

Thank you for your help

Ensure that the PASSBOLT_BASE_URL and PASSBOLT_FINGERPRINT environment variables are set correctly. They should not be empty strings as shown in your playbook. Confirm that the user_id variable is set to a valid user ID that exists in Passbolt. Make sure that the anatomicjc.passbolt.passbolt plugin is installed and configured correctly on the system where Ansible is running. Check if the Passbolt server is accessible and the GPG fingerprint is correctly recognized by the server.

I missed this one but I discussed a bit with @antony some time ago about a similar case.
For those who have the same issue while using gnupg with the ansible plugin, here are some points.

If your gpg secret key is protected by a passphrase, you will encounter issues if you don’t have any gpg agent running. ansible-playbook won’t be able to decrypt the secret key.

When I developed this plugin, I had a GPG agent on my laptop and when ansible-playbook try to communicate with passbolt, I have a popup asking to enter the passphrase to unlock the GPG key.

If you run ansible-playbook from a Linux server without any graphical environment, you have to set the GPG_TTY environment variable like this:

GPG_TTY=$(tty)
export GPG_TTY

Then when you will run your ansible-playbook, you will get a prompt like the one below to enter your passphrase.

Hope this help

My apologies, I forgot to mention that the problem has been resolved. After a meeting with @antony, I added two variables to the .bashrc file, which solved the issue.

Thank you for your assistance!

P.S.: If you ever have some time, I’d love to discuss with you and share some ideas that might help improve certain functionalities of the API. :slight_smile: