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.