Skip to content

Commit e85a6b8

Browse files
committed
Added documentation for new parameter
1 parent e6b11f3 commit e85a6b8

File tree

2 files changed

+47
-30
lines changed

2 files changed

+47
-30
lines changed

plugins/README.md

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,7 @@
11
# Collections Plugins Directory
22

3-
This directory can be used to ship various plugins inside an Ansible collection. Each plugin is placed in a folder that
4-
is named after the type of plugin it is in. It can also include the `module_utils` and `modules` directory that
5-
would contain module utils and modules respectively.
6-
7-
Here is an example directory of the majority of plugins currently supported by Ansible:
8-
93
```
104
└── plugins
11-
├── action
12-
├── become
13-
├── cache
14-
├── callback
15-
├── cliconf
16-
├── connection
17-
├── filter
18-
├── httpapi
19-
├── inventory
20-
├── lookup
21-
├── module_utils
22-
├── modules
23-
├── netconf
24-
├── shell
25-
├── strategy
26-
├── terminal
27-
├── test
28-
└── vars
5+
├── [module_utils](https://github.com/NETWAYS/ansible-collection-elasticstack/tree/main/plugins/module_utils)
6+
└── [modules](https://github.com/NETWAYS/ansible-collection-elasticstack/tree/main/plugins/modules)
297
```
30-
31-
A full list of plugin types can be found at [Working With Plugins](https://docs.ansible.com/ansible-core/2.13/plugins/plugins.html).

plugins/modules/README.md

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
## `cert_info` module
1616

17-
The netways.elasticstack.cert_info module gathers information about pkcs12 certificates generated by the Elastic stack cert util.
17+
The netways.elasticstack.cert_info module gathers information about pkcs12 certificates generated by the Elasticstack cert util.
1818

1919
### Dependencies
2020
- python-cryptography >= 2.5.0 on the remote node
@@ -71,9 +71,11 @@ Currently, the information of the following extensions and values will be return
7171
`path`:
7272
Absolute path to certificate. (**Default:** undefined, required)
7373

74-
`password`:
75-
The password of the pkcs12 certificate. (**Default:** No default, optional)
74+
`passphrase`:
75+
The passphrase of the pkcs12 certificate. (**Default:** No default, optional)
7676

77+
`passphrase_check`:
78+
This will only check the passphrase and returns a bool in the results. If enabled it won't return any certificate information, only the passphrase_check result. (**Default:** False, optional)
7779

7880
### Returns
7981
All keys and values that will be returned with the results variable of the module:
@@ -101,12 +103,15 @@ The serial number of the certificate as **str** which represents an integer.
101103
- `critical`: The value of critical as **str** which represents a bool.
102104
- `values`: The keys and their values of the extension as **str**. (See: Supported extensions)
103105

106+
`passphrase_check`:
107+
A **bool** that will be `True` if the passphrase check was positive and `False`, if not. It's also possible that it returns `False` if the certificate is corrupted, since Python can't differentiate it and handles exceptions like this as a "VauleError".
108+
104109
### Example
105110
```
106111
- name: Test
107112
cert_info:
108113
path: /opt/es-ca/elasticsearch-ca.pkcs12
109-
password: PleaseChangeMe
114+
passphrase: PleaseChangeMe
110115
register: test
111116
112117
- name: Debug
@@ -156,3 +161,39 @@ ok: [localhost] => {
156161
}
157162
}
158163
```
164+
165+
### Example of passphrase_check
166+
```
167+
- name: Test correct passphrase wit passphrase_check parameter
168+
cert_info:
169+
path: /opt/es-ca/elasticsearch-ca.pkcs12
170+
passphrase: PleaseChangeMe
171+
passphrase_check: True
172+
register: test
173+
174+
- name: Debug
175+
debug:
176+
msg: "{{ test }}"
177+
```
178+
179+
**Output**:
180+
```
181+
TASK [Test correct passphrase wit passphrase_check parameter] ******************
182+
ok: [localhost]
183+
184+
TASK [Debug] *******************************************************************
185+
ok: [localhost] => {
186+
"msg": {
187+
"changed": false,
188+
"extensions": {},
189+
"failed": false,
190+
"issuer": "",
191+
"not_valid_after": "",
192+
"not_valid_before": "",
193+
"passphrase_check": true,
194+
"serial_number": "",
195+
"subject": "",
196+
"version": ""
197+
}
198+
}
199+
```

0 commit comments

Comments
 (0)