community.windows.win_certificate_info – Get information on certificates from a Windows Certificate Store¶
Note
This plugin is part of the community.windows collection (version 1.3.0).
To install it use: ansible-galaxy collection install community.windows
.
To use it in a playbook, specify: community.windows.win_certificate_info
.
Parameters¶
Parameter | Choices/Defaults | Comments |
---|---|---|
store_location
string
|
|
The location of the store to search.
|
store_name
string
|
Default: "My"
|
The name of the store to search.
See https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.x509certificates.storename for a list of built-in store names.
|
thumbprint
string
|
The thumbprint as a hex string of a certificate to find.
When specified, filters the certificates return value to a single certificate
See the examples for how to format the thumbprint.
|
See Also¶
See also
- ansible.windows.win_certificate_store
The official documentation on the ansible.windows.win_certificate_store module.
Examples¶
- name: Obtain information about a particular certificate in the computer's personal store
community.windows.win_certificate_info:
thumbprint: BD7AF104CF1872BDB518D95C9534EA941665FD27
register: mycert
# thumbprint can also be lower case
- name: Obtain information about a particular certificate in the computer's personal store
community.windows.win_certificate_info:
thumbprint: bd7af104cf1872bdb518d95c9534ea941665fd27
register: mycert
- name: Obtain information about all certificates in the root store
community.windows.win_certificate_info:
store_name: Root
register: ca
# Import a pfx and then get information on the certificates
- name: Import pfx certificate that is password protected
ansible.windows.win_certificate_store:
path: C:\Temp\cert.pfx
state: present
password: VeryStrongPasswordHere!
become: yes
become_method: runas
register: mycert
- name: Obtain information on each certificate that was touched
community.windows.win_certificate_info:
thumbprint: "{{ item }}"
register: mycert_stats
loop: "{{ mycert.thumbprints }}"
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Micah Hunsberger (@mhunsber)