Skip to content

Commit

Permalink
add test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelamattes committed Sep 6, 2024
1 parent 27cf1d7 commit 2346612
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
- name: Test if include_role is working
hosts: localhost
tasks:
- name: Create and upload Lets Encrypt certificates
ansible.builtin.include_role:
name: telekom_mms.acme.acme
public: yes

Check failure on line 8 in tests/integration/targets/acme_letsencrypt/dns-challenge-include-role.yml

View workflow job for this annotation

GitHub Actions / Ansible Lint

yaml[truthy]

Truthy value should be one of \[false, true]
vars:
acme_domain:
certificate_name: dns-pebble.example.com
zone: example.com
email_address: [email protected]
subject_alt_name:
- example.com
acme_challenge_provider: pebble
acme_use_live_directory: false
acme_account_email: [email protected]
acme_staging_directory: https://localhost:14000/dir
acme_validate_certs: false
post_tasks:
- name: Validate certs
community.crypto.x509_certificate_info:
path: "{{ acme_cert_path }}"
register: result

- name: Print the certificate
ansible.builtin.debug:
msg: "{{ result }}"

- name: Check if the certificate is correct
ansible.builtin.assert:
that:
- "'DNS:example.com' in result.subject_alt_name"
- "'Pebble Intermediate CA' in result.issuer.commonName"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- name: Test role if acme_domain is not set
hosts: localhost
roles:
- telekom_mms.acme.acme
vars:
acme_challenge_provider: pebble
acme_use_live_directory: false
acme_account_email: [email protected]
acme_staging_directory: https://localhost:14000/dir
acme_validate_certs: false

0 comments on commit 2346612

Please sign in to comment.