-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathconverge.yml
More file actions
62 lines (62 loc) · 2.01 KB
/
Copy pathconverge.yml
File metadata and controls
62 lines (62 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
# The workaround for arbitrarily named role directory is important because the git repo has one name and the role within it another
# Found at: https://github.com/ansible-community/molecule/issues/1567#issuecomment-436876722
- name: Converge
collections:
- netways.elasticstack
hosts: localhost
tasks:
#
# Test modules
#
- name: Test
cert_info:
path: files/es-ca/elastic-stack-ca.p12
passphrase: PleaseChangeMe
register: test
- name: Debug
ansible.builtin.debug:
msg: "{{ test }}"
- name: Test required parameters (missing path)
cert_info:
passphrase: PleaseChangeMe
ignore_errors: true
- name: Test wrong path
cert_info:
path: es-ca-wrong
passphrase: PleaseChangeMe
ignore_errors: true
- name: Debug with to_datetime() - (( test.not_valid_after | to_datetime()) - (ansible_date_time.date | to_datetime('%Y-%m-%d'))).days
ansible.builtin.debug:
msg: >-
"{{ (( test.not_valid_after | to_datetime()) - (ansible_date_time.date | to_datetime('%Y-%m-%d'))).days }}"
- name: Test wrong passphrase
cert_info:
path: files/es-ca/elastic-stack-ca.p12
passphrase: PleaseChangeMe-wrong
ignore_errors: true
- name: Test no passphrase
cert_info:
path: files/es-ca/elastic-stack-ca.p12
ignore_errors: true
- name: Test no parameters
cert_info:
ignore_errors: true
- name: Test wrong passphrase with passphrase_check parameter
cert_info:
path: files/es-ca/elastic-stack-ca.p12
passphrase: PleaseChangeMe-wrong
passphrase_check: true
register: pass_check
- name: Debug
debug:
msg: "{{ pass_check }}"
- name: Test correct passphrase with passphrase_check parameter
cert_info:
path: files/es-ca/elastic-stack-ca.p12
passphrase: PleaseChangeMe
passphrase_check: true
register: pass_check
- name: Debug
debug:
msg: "{{ pass_check }}"