daniel-lynch / daniel_lynch.passbolt

Passbolt Ansible collection
https://galaxy.ansible.com/daniel_lynch/passbolt
GNU General Public License v3.0
6 stars 7 forks source link

create_password module has broken idempotency #13

Open tombayo opened 3 months ago

tombayo commented 3 months ago

Using the create_password module repeatedly creates multiple passwords in Passbolt with the same values.

Example ansible-task:

- name: Test creating password
  delegate_to: localhost
  daniel_lynch.passbolt.create_password:
    passbolt_uri: "{{ PASSBOLT_BASE_URL }}"
    gpgkey: "{{ PASSBOLT_PRIVATE_KEY }}"
    passphrase: "{{ PASSBOLT_PASSPHRASE }}"
    name: ansible-test-password
    password: testing123
    username: ansible
    description: Used for testing

The result of running this task multiple times looks like this in the GUI: image

The result when attempting to retrieve the password is a string with all these passwords concatenated with a comma:

ok: [localhost] => {
    "msg": "testing123,testing123,testing123"
}
svennd commented 1 month ago

You could use : https://github.com/daniel-lynch/daniel_lynch.passbolt/blob/main/docs/source/modules/get_or_create_password.rst