win_credential – Manages Windows Credentials in the Credential Manager¶
New in version 2.8.
Synopsis¶
Used to create and remove Windows Credentials in the Credential Manager.
This module can manage both standard username/password credentials as well as certificate credentials.
Parameters¶
Notes¶
Note
This module requires to be run with
become
so it can access the user’s credential store.There can only be one credential per host and type. if a second credential is defined that uses the same host and type, then the original credential is overwritten.
See Also¶
See also
- win_user_right – Manage Windows User Rights
The official documentation on the win_user_right module.
- win_whoami – Get information about the current user and process
The official documentation on the win_whoami module.
Examples¶
- name: Create a local only credential
win_credential:
name: server.domain.com
type: domain_password
username: DOMAIN\username
secret: Password01
state: present
- name: Remove a credential
win_credential:
name: server.domain.com
type: domain_password
state: absent
- name: Create a credential with full values
win_credential:
name: server.domain.com
type: domain_password
alias: server
username: username@DOMAIN.COM
secret: Password01
comment: Credential for server.domain.com
persistence: enterprise
attributes:
- name: Source
data: Ansible
- name: Unique Identifier
data: Y3VzdG9tIGF0dHJpYnV0ZQ==
data_format: base64
- name: Create a certificate credential
win_credential:
name: '*.domain.com'
type: domain_certificate
username: 0074CC4F200D27DC3877C24A92BA8EA21E6C7AF4
state: present
- name: Create a generic credential
win_credential:
name: smbhost
type: generic_password
username: smbuser
secret: smbuser
state: present
- name: Remove a generic credential
win_credential:
name: smbhost
type: generic_password
state: absent
Status¶
This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by the Ansible Community. [community]
Authors¶
Jordan Borean (@jborean93)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.