Cannot find google secret manager module in ansible

I am trying to Write some data to the GCP Secret manager using my account which is already authenticated. I am using this playbook.

  • name: Add secret to Google Cloud Secret Manager
    hosts: localhost
    gather_facts: no
    tasks:
    • name: Set secret value
      set_fact:
      secret_value: “my-secret-value”

    • name: Add secret version
      google.cloud.gcp_secret_manager_secret_version:
      name: “projects/{{ gcp_project }}/secrets/{{ secret_name }}”
      data: “{{ secret_value }}”
      state: present
      delegate_to: localhost

However this is not able to locate the module google.cloud.gcp_secret_manager_secret_version. I cannot find any module related to secrets in cloud.google.

ERROR! couldn’t resolve module/action ‘google.cloud.gcp_secret_manager_secret_version’. This often indicates a misspelling, missing collection, or incorrect module path.

The error appears to be in ‘/home/ansible/win-playbooks/win_ad/secretmain.yml’: line 10, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

Is this what you are looking for?

This is written in Go. I am using python modules under ansible collection. Do you have something in python?

Try searching GitHub? That’s what I did, it isn’t something I’ve used.

There doesn’t seem to be anything matching gcp_secret_manager_secret_version on Ansible Galaxy.

What is the source of the playbook you are using?

I don’t think there’s such a module in google.cloud. At least, I don’t see one in the list of modules.

There’s a PR about a gcp_secret_manager module which might be what you’re looking for, but it’s not merged yet.

1 Like

At last, it was merged, but not clear when it will be released :frowning:

I’ve recently opened an issue to ask for a new release but didn’t get an answer yet. I’ve added that users are waiting for this module, but I’m not sure if this helps.

@gundalow Do you think you have better ways to contact the maintainers than me? I’d like to avoid creating a vote on removing this collection and then you present some people who say they’ll work on it. If you have a more direct connection, I think you should (try to) use it now.

Thanks for the ping, I appreciate this, and as you say it’s a better way to work.

The people I used to know have moved on to other projects. I’ve asked internally to see if we’ve got any contacts. I’ll let you know.

1 Like

There should be a collection release in the next month or two.

1 Like

Cool! Thanks @gundalow! I’ll keep it on my list and tick it off once the release is there.

1 Like

There has been a new release today both on GitHub and Galaxy which seems to contain a new module gcp_secret_manager. Maybe this helps you.

If you don’t install the collection directly but use the Ansible community package, I’m afraid you have to wait another two weeks. ETA for Ansible 9.10.0 / 10.4.0 is September 10.